Building the Heap while Reading the File I
Rather than seeking every time we want a new record, we read blocks of records at a time into a buffer and operate on that block before moving to a new block.
The input buffer for each new block of keys becomes part of the memory area set up for the heap. Each time we read a new block, we just append it to the end of the heap.
The first new record is then at the end of the heap array, as required by the insert function.
Once a record is inserted, the next new record is at the end of the heap array ready to be inserted as well.