In
computer science, an implicit data structure or space-efficient data structure is a
data structure
In computer science, a data structure is a data organization, management, and storage format that is usually chosen for efficient access to data. More precisely, a data structure is a collection of data values, the relationships among them, a ...
that stores very little information other than the main or required data: a data structure that requires low
overhead. They are called "implicit" because the position of the elements carries meaning and relationship between elements; this is contrasted with the use of
pointers to give an ''explicit'' relationship between elements. Definitions of "low overhead" vary, but generally means constant overhead; in
big O notation
Big ''O'' notation is a mathematical notation that describes the limiting behavior of a function when the argument tends towards a particular value or infinity. Big O is a member of a family of notations invented by Paul Bachmann, Edmund Lan ...
, ''O''(1) overhead. A less restrictive definition is a
succinct data structure, which allows greater overhead.
Definition
An implicit data structure is one with constant space overhead (above the
information-theoretic lower bound).
Historically, defined an implicit data structure (and algorithms acting on one) as one "in which structural information is implicit in the way data are stored, rather than explicit in pointers." They are somewhat vague in the definition, defining it most strictly as a single array, with only the size retained (a single number of overhead), or more loosely as a data structure with constant overhead (). This latter definition is today more standard, and the still-looser notion of a data structure with non-constant but small overhead is today known as a
succinct data structure, as defined by ; it was referred to as semi-implicit by .
["We will also suggest two structures which might be described as “semi-implicit,” in that a variable, but ''o''(''N''), number of pointers (indices) is kept.", p. 238]
A fundamental distinction is between
''static'' data structures (read-only) and
''dynamic'' data structures (which can be modified). Simple implicit data structures, such as representing a sorted list as an array, may be very efficient as a static data structure, but inefficient as a dynamic data structure, due to modification operations (such as insertion in the case of a sorted list) being inefficient.
Examples
A trivial example of an implicit data structure is an ''
array data structure
In computer science, an array is a data structure consisting of a collection of ''elements'' (values or variables), each identified by at least one ''array index'' or ''key''. An array is stored such that the position of each element can be co ...
'', which is an implicit data structure for a
list, and requires only the constant overhead of the length; unlike a
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 whic ...
, which has a pointer associated with each data element, which ''explicitly'' gives the relationship from one element to the next. Similarly, a ''
null-terminated string'' is an implicit data structure for a
string
String or strings may refer to:
*String (structure), a long flexible structure made from threads twisted together, which is used to tie, bind, or hang other objects
Arts, entertainment, and media Films
* ''Strings'' (1991 film), a Canadian anim ...
(list of characters). These are considered very simple because they are static data structures (read-only), and only admit the simple operation of iteration over the elements.
Similarly simple is representing a
multi-dimensional array
In computer science, array is a data type that represents a collection of ''elements'' (values or variables), each selected by one or more indices (identifying keys) that can be computed at run time during program execution. Such a collection i ...
as a single 1-dimensional array, together with its dimensions. For example, representing an ''m'' × ''n'' array as a single list of length ''m·n'', together with the numbers ''m'' and ''n'' (instead of as a 1-dimensional array of pointers to each 1-dimensional subarray). The elements need not be of the same type, and a
table of data (a list of
records) may similarly be represented implicitly as a flat (1-dimensional) list, together with the length of each
field, so long as each field has uniform size (so a single size can be used per field, not per record).
A less trivial example is representing a sorted list by a ''
sorted array
A sorted array is an array data structure in which each element is sorted in numerical, alphabetical, or some other order, and placed at equally spaced addresses in computer memory. It is typically used in computer science to implement static l ...
'', which allows search in logarithmic time by
binary search. Contrast with a
search tree, specifically a
binary search tree, which also allows logarithmic-time search, but requires pointers. A sorted array is only efficient as a static data structure, as modifying the list is slow – unlike a binary search tree – but does not require the space overhead of a tree.
An important example of an implicit data structure is representing a
perfect binary tree as a list, in increasing order of depth, so root, first left child, first right child, first left child of first left child, etc. Such a tree occurs notably for an
ancestry chart to a given depth, and the implicit representation is known as an ''
Ahnentafel'' (ancestor table).
This can be generalized to a
complete binary tree (where the last level may be incomplete), which yields the best-known example of an implicit data structure, namely the ''
binary heap'', which is an implicit data structure for a
priority queue
In computer science, a priority queue is an abstract data-type similar to a regular queue or stack data structure in which each element additionally has a ''priority'' associated with it. In a priority queue, an element with high priority is se ...
. This is more sophisticated than earlier examples because it allows multiple operations, and is an efficient ''dynamic'' data structure (it allows efficient modification of the data): not only top, but also insert and pop.
More sophisticated implicit data structures include the
beap (bi-parental heap).
History
The trivial examples of lists or tables of values date to prehistory, while historically non-trivial implicit data structures date at least to the Ahnentafel, which was introduced by
Michaël Eytzinger in 1590 for use in genealogy. In formal computer science, the first implicit data structure is generally considered to be the sorted list, used for binary search, which was introduced by
John Mauchly in 1946, in the
Moore School Lectures, the first ever set of lectures regarding any computer-related topic.
The binary heap was introduced in to implement the
heapsort.
The notion of an implicit data structure was formalized in , as part of introducing and analyzing the
beap.
References
*
*
{{refend
Further reading
See publications o
Hervé Brönnimann J. Ian Munro
James Ian Munro (born July 10, 1947)Curriculum vitae, as printed in the front matter of ''Space-Efficient Data Structures, Streams, and Algorithms''. is a Canadian computer scientist. He is known for his fundamental contributions to algorithms and ...
, an
Greg Frederickson
Data structures