Suppose you have a large file made up of a bunch of fixed size blocks. Each of these blocks contains some number of variable sized records. Each record must fit completely w
Here's an algorithm you might be able to leverage, albeit your records within fixed size blocks might require a little bit more work.
Heap Defragmentation in Bounded Time