Your laptop's RAM holds maybe 16 GB. The disk next to it holds 1 TB or more — sixty times as much. When a dataset fits in RAM, the classic algorithms you learned work perfectly. When it doesn't, you run into one of the most underrated facts in computer science: moving a block of data from disk to RAM is roughly 100,000 times slower than reading the same data from cache.
That gap changes everything. An algorithm that makes a million comparisons but only reads the disk three times will obliterate one that makes a thousand comparisons but reads the disk ten thousand times. The comparisons are essentially free; the I/O transfers are the real cost.
External-memory algorithms — also called I/O-efficient algorithms or out-of-core algorithms — are designed precisely for this regime. Instead of counting comparisons or arithmetic operations, they count disk block transfers: each time you load one chunk of B bytes from disk into RAM, that costs one unit. The model was formalized by Aggarwal and Vitter in 1988, and it transformed how we think about sorting, searching, and graph traversal on large datasets.
The core insight is simple: bring data into RAM in large, sequential chunks, and process as much of each chunk as possible before discarding it. Algorithms that do this well — like external merge sort and B-trees — dominate real-world database and file-system engineering.
Comments
Loading comments...