Random access

In computer science it is typically contrasted to sequential access which requires data to be retrieved in the order it was stored.

At first, the term "random access" was used because the process had to be capable of finding records no matter in which sequence they were required.

[3] A typical illustration of this distinction is to compare an ancient scroll (sequential; all material prior to the data needed must be unrolled) and the book (direct: can be immediately flipped open to any arbitrary page).

A more modern example is a cassette tape (sequential — one must fast forward through earlier songs to get to later ones) and a CD (direct access — one can skip to the track wanted, knowing that it would be the one retrieved).

Direct access is required, or at least valuable, in many algorithms such as binary search, integer sorting, or certain versions of sieve of Eratosthenes.

Random access compared to sequential access