24.8 Case Study: File Merge Sort (cont.)
Phase II
- Remove 2 files from queue, open them
- Merge contents (can be done holding a few elements in memory),
writing to new temporary file
- Delete 2 old files
- Make another pass over input, removing duplicates
- Add new file to end of queue
- If there's more than 1 file on the queue, goto 1
- Copy final file to stdout
prev
|top
|next