Domanda di colloquio di Gainsight

Quick sort code and questions about time complexity