Azienda coinvolta
FInd the kth largest element in an array.
Anonimo
Solution 1:- sorting (Merge sort) then print element. complexity: Time O(nlogn) Space: O(n) Solution 2: create a min heap with K size complexity Time O(nlogk) space: O(k)
Non lasciarti sfuggire opportunità e informazioni privilegiate seguendo le aziende dove vorresti lavorare.
Ricevi suggerimenti e aggiornamenti personalizzati avviando le tue ricerche.