Write a program to find 100 largest numbers out of an array of 1 billion numbers
You can keep a priority queue of the 100 biggest numbers, iterate through the 1 billion numbers. Whenever you encounter a number greater than the smallest number in the queue (the head of the queue), remove the head of the queue and add the new number to the queue. A priority queue implemented with a … Read more