1.2 KiB
1.2 KiB
-
file operations
- write to file (at index)
- read file
-
a tape type - representing a file?
-
a record type - x1,x2,x3,x4,x5
- comparing records
-
buffer quick sort
-
configuration
- cmd args - man getopts
-
file input
-
keyboard input
-
stage 1
- reading chunks
- sorting
- writing runs
-
stage 2
-
implement a min heap with following operations
- pop
- push
-
step 4
- split the buffer into chunks of size n, and (b-1)n
- create a min heap of size (b-1)n
- populate the heap with (b-1) runs of n elements (each from a different file)
- find a way to mark if a last element from a certain file has been popped
- when a merged buffer is full, write it to file
- pop off the top element until there are no more elements from a certain array
- load another run from that file, and rehapify
- repeat untill all files empty
- the resulting file should get the new smallest filename in tmp dir
-
multiway merge
-
writing larger runs
-
repeat untill done
-
-
counting read, and write operations
-
testing
-
report