Kth-Largest Element in an Array
題目來源題目說明解題思路因爲只是要找第K大的元素,因此沒必要也盡量避免使用Sorting -- 而且因爲數據量較大,可能會超時建Min Heap核心概念:保持一個「大小為 k」的小堆,堆頂是目前第k大的元素priority_queue (其實就是Max Heap)參考程式碼:class Solution { public: int findKthLargest(vector<int>&...