Gainsight Interview Question

Quick sort code and questions about time complexity