There are 1 billion integers stored in a file. One line per integer. Memory can support loading of 1 million integers at a time. We need to display 100 largest integers.
My thoughts :
- Use a max heap data structure of size 100.
- Take 1st million integers from the file and put in the heap.