
Sequential access is a term describing a group of elements (such as data in a memory array or a
disk file or on
magnetic-tape data storage
Magnetic-tape data storage is a system for storing digital information on magnetic tape using digital recording.
Tape was an important medium for primary data storage in early computers, typically using large open reels of 7-track, later ...
) being accessed in a predetermined, ordered
sequence
In mathematics, a sequence is an enumerated collection of objects in which repetitions are allowed and order matters. Like a set, it contains members (also called ''elements'', or ''terms''). The number of elements (possibly infinite) is cal ...
. It is the opposite of
random access
Random access (also called direct access) is the ability to access an arbitrary element of a sequence in equal time or any datum from a population of addressable elements roughly as easily and efficiently as any other, no matter how many elemen ...
, the ability to access an arbitrary element of a sequence as easily and efficiently as any other at any time.
Sequential access is sometimes the only way of accessing the data, for example if it is on a tape. It may also be the access method of choice, for example if all that is wanted is to process a sequence of data elements in order.
Definition
There is no consistent definition in
computer science
Computer science is the study of computation, information, and automation. Computer science spans Theoretical computer science, theoretical disciplines (such as algorithms, theory of computation, and information theory) to Applied science, ...
of sequential access or sequentiality. In fact, different sequentiality definitions can lead to different sequentiality quantification results. In spatial dimension, request size, stride distance, backward accesses, re-accesses can affect sequentiality. For temporal sequentiality, characteristics such as multi-stream and inter-arrival time threshold has impact on the definition of sequentiality.
[''Cheng Li et al.']
Assert(!Defined(Sequential I/O))
HotStorage. 2014
In
data structure
In computer science, a data structure is a data organization and storage format that is usually chosen for Efficiency, efficient Data access, access to data. More precisely, a data structure is a collection of data values, the relationships amo ...
s, a data structure is said to have sequential access if one can only visit the values it contains in one particular order. The canonical example is the
linked list
In computer science, a linked list is a linear collection of data elements whose order is not given by their physical placement in memory. Instead, each element points to the next. It is a data structure consisting of a collection of nodes whi ...
. Indexing into a list that has sequential access requires
O(''n'') time, where ''n'' is the index. As a result, many algorithms such as
quicksort
Quicksort is an efficient, general-purpose sorting algorithm. Quicksort was developed by British computer scientist Tony Hoare in 1959 and published in 1961. It is still a commonly used algorithm for sorting. Overall, it is slightly faster than ...
and
binary search
In computer science, binary search, also known as half-interval search, logarithmic search, or binary chop, is a search algorithm that finds the position of a target value within a sorted array. Binary search compares the target value to the m ...
degenerate into bad algorithms that are even less efficient than their naive alternatives; these algorithms are impractical without
random access
Random access (also called direct access) is the ability to access an arbitrary element of a sequence in equal time or any datum from a population of addressable elements roughly as easily and efficiently as any other, no matter how many elemen ...
. On the other hand, some algorithms, typically those that do not have index, require only sequential access, such as
mergesort, and face no penalty.
See also
*
Direct-access storage device
A direct-access storage device (DASD) (pronounced ) is a secondary storage device in which "each physical record has a discrete location and a unique address". The term was coined by IBM to describe devices that allowed random access to data, th ...
*
Queued sequential access method
*
Sequential data
References
{{reflist
Computer memory