Friday, January 17, 2014

Write code to find nth largest number from a stream of numbers.


Write code to find nth largest number from a stream of numbers.
Solution:
Use a n size min heap.
Create a n-size min-heap. nth largest will be always at the root of the heap

0 comments:

Post a Comment