Question d’entretien chez Visible Alpha

Round 2: Find Kth max element from unsorted array.

Réponse à la question d'entretien

Utilisateur anonyme

1 janv. 2019

The standard answer for this is to use max binary heap, which will provide you answer in O(nlogn) but I did not knew about that so I said I will start sorting the array using quick sort and will stop sorting when I find kth max, so no need to sort complete array and hence complexity is less than O(n) on average.