In the video, it is discussed that obtaining say top 10 entries from 100 entries using heap / priority queue would take 10 log n time instead of (n log n) in case of sorting.
But wouldn’t we require(n log n) time to build the heap in the first place?
Priority Queue / Heap
@gautam74
you can also build the heap in O(n) time it work preety fine and you will learn it it next vedio after O(nlogn) implementation and it only take 10logn time to give our first 10 elements
if you still have any dout feel free to ask and if clear mark it as resolved and rate my experience
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.