nextfit
Next-fit, often written as next-fit, is an online heuristic used in the bin packing problem and in dynamic memory allocation. In bin packing, items with sizes are placed into fixed-capacity bins as a sequence is processed. The algorithm keeps a single open bin at a time: if the next item fits in the open bin, it is placed there; otherwise, the open bin is closed and a new bin is opened for that item. The process continues with the new bin being the open bin until it also fills.
Performance and characteristics: Next-fit runs in linear time O(n) with respect to the number of items and
In memory allocation, next-fit describes placing a memory request into the current free block if it fits;
History and relation: Next-fit is one of the classic online bin packing heuristics analyzed in competitive