Back to Question

Kth Largest Element in an Array (Quickselect/Heap)

Question Explain

Given an unsorted array of numbers, find the $k$-th largest element. Solve using either Quickselect (average $O(n)$) or a Min-Heap (Max-Heap) ($O(n \log k)$).

Start Trying This Question Simulation

Click "Start Speaking" and answer the question naturally.