Random Access

In computer science, random access (sometimes called direct access) is the ability to access an element at an arbitrary position in a sequence in equal time, independent of sequence size. The position is arbitrary in the sense that it is unpredictable, thus the use of the term "random" in "random access". The opposite is sequential access, where a remote element takes longer time to access. 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 (random: can be immediately flipped open to any random page). A more modern example is a cassette tape (sequential—you have to fast-forward through earlier songs to get to later ones) and a CD (random access—you can skip to the track you want).

In data structures, random access implies the ability to access any entry in a list in constant (i.e. independent of its position in the list and of list's size, i.e. ) time. Very few data structures can guarantee this, other than arrays (and related structures like dynamic arrays). Random access is critical, or at least valuable, to many algorithms such as binary search, integer sorting or certain versions of sieve of Eratosthenes. Other data structures, such as linked lists, sacrifice random access to make for efficient inserts, deletes, or reordering of data. Self-balancing binary search trees may provide an acceptable compromise, where access time is equal for any member of a collection and only grows logarithmically with its size.

Famous quotes containing the words random and/or access:

    It is a secret from nobody that the famous random event is most likely to arise from those parts of the world where the old adage “There is no alternative to victory” retains a high degree of plausibility.
    Hannah Arendt (1906–1975)

    In the greatest confusion there is still an open channel to the soul. It may be difficult to find because by midlife it is overgrown, and some of the wildest thickets that surround it grow out of what we describe as our education. But the channel is always there, and it is our business to keep it open, to have access to the deepest part of ourselves.
    Saul Bellow (b. 1915)