What is a good algorithm for compacting records in a blocked file?

前端 未结 4 1147
长情又很酷
长情又很酷 2021-01-20 05:31

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

4条回答
  •  爱一瞬间的悲伤
    2021-01-20 05:52

    A modification of an on-line (to defragment in one pass) bounded space (the memory requirements) bin packing algorithm could probably work here.

    See "Bin Packing Approximation Algorithms: Combinatorial Analysis" by Coffman et al.

提交回复
热议问题