Algorithm
0 Answers
Algorithm
| Flag | PURGE
Consider an implicit binary min-heap with n distinct elements. Let k be an integer much
smaller than n, but not a constant. The root of the heap contains the smallest value. Where
in the heap can the kth smallest value be located? Be precise. Describe how to find the kth
smallest value, given a heap (which you cannot modify!) in time dependent on k, but not n.
What is the algorithm? What is its worst-case running time? Be precise.
Email me when people comment.
Email me when people comment.
Loading...
An error occurred in subscribing you.
Email me when people comment.
Email me when people comment.
Loading...
An error occurred in subscribing you.
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.