the.com/space search
finding the closest empty parking spot in an array, one gap at a time.
means an algorithmic technique that scans for the nearest available slot or gap in a structure, like memory, a disk, or a grid, before placing something new.
from the term grew out of memory allocation systems in early operating systems, where the OS had to hunt through fragmented memory blocks for a spot big enough to hold a new process, giving rise to strategies like first-fit, best-fit, and worst-fit.
three main strategiesfirst-fit, best-fit, and worst-fit compete for speed
fragmentation villainbad space search worsens external memory fragmentation
game ai usepathfinding grids literally search open space to move
disk allocationfilesystems still hunt free blocks the same way
for instance
buddy memory allocation — linux kernel splits memory in powers of two since the 1960s
tetris piece placement — engines search the board for the tightest fitting gap