HOME

TheInfoList




In
computer science Computer science deals with the theoretical foundations of information, algorithms and the architectures of its computation as well as practical techniques for their application. Computer science is the study of , , and . Computer science ...
, a data structure is a data organization, management, and storage format that enables efficient access and modification. More precisely, a data structure is a collection of data values, the relationships among them, and the functions or operations that can be applied to the data, i.e., it is an
algebraic structure In mathematics Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mathematical analysis, analysis). It ...
about
data Data (; ) are individual facts, statistics, or items of information, often numeric. In a more technical sense, data are a set of values of qualitative property, qualitative or quantity, quantitative variable (research), variables about one or m ...

data
.


Usage

Data structures serve as the basis for
abstract data type In computer science, an abstract data type (ADT) is a mathematical model for data types. An abstract data type is defined by its behavior (Semantics (computer science), semantics) from the point of view of a ''user'', of the data, specifically in ...
s (ADT). The ADT defines the logical form of the data type. The data structure implements the physical form of the data type. Different types of data structures are suited to different kinds of applications, and some are highly specialized to specific tasks. For example, relational databases commonly use
B-tree In computer science Computer science deals with the theoretical foundations of information, algorithms and the architectures of its computation as well as practical techniques for their application. Computer science is the study of Algo ...

B-tree
indexes for data retrieval, while
compiler In computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithmic processes and development of both computer hardware , hardware and soft ...

compiler
implementations usually use
hash table In computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithmic processes and development of both computer hardware , hardware and s ...
s to look up identifiers. Data structures provide a means to manage large amounts of data efficiently for uses such as large
database In , a database is an organized collection of stored and accessed electronically from a . Where databases are more complex they are often developed using formal techniques. The (DBMS) is the that interacts with s, applications, and the data ...

database
s and internet indexing services. Usually, efficient data structures are key to designing efficient
algorithm In and , an algorithm () is a finite sequence of , computer-implementable instructions, typically to solve a class of problems or to perform a computation. Algorithms are always and are used as specifications for performing s, , , and other ...

algorithm
s. Some formal design methods and
programming language A programming language is a formal language In mathematics Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calcu ...

programming language
s emphasize data structures, rather than algorithms, as the key organizing factor in software design. Data structures can be used to organize the storage and retrieval of information stored in both
main memory A spindle of DVD-RWs Computer data storage is a technology consisting of computer components and Data storage device, recording media that are used to retain digital data (computing), data. It is a core function and fundamental component of ...
and secondary memory.


Implementation

Data structures are generally based on the ability of a
computer A computer is a machine that can be programmed to carry out sequences of arithmetic or logical operations automatically. Modern computers can perform generic sets of operations known as Computer program, programs. These programs enable compu ...

computer
to fetch and store data at any place in its memory, specified by a pointer—a bit string, representing a
memory address In computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithmic processes and development of both computer hardware , hardware and softwa ...
, that can be itself stored in memory and manipulated by the program. Thus, the
array ARRAY, also known as ARRAY Now, is an independent distribution company launched by film maker and former publicist Ava DuVernay Ava Marie DuVernay (; born August 24, 1972) is an American filmmaker. She won the directing award in the U.S. dramat ...
and record data structures are based on computing the addresses of data items with
arithmetic operations Arithmetic (from the Greek ἀριθμός ''arithmos'', 'number A number is a mathematical object used to counting, count, measurement, measure, and nominal number, label. The original examples are the natural numbers 1, 2, 3, 4, and so for ...
, while the
linked data structureIn computer science Computer science deals with the theoretical foundations of information, algorithms and the architectures of its computation as well as practical techniques for their application. Computer science is the study of Algorith ...
s are based on storing addresses of data items within the structure itself. The implementation of a data structure usually requires writing a set of
procedures Procedure may refer to: * Medical procedure * Instructions or recipes, a set of commands that show how to achieve some result, such as to prepare or make something * Procedure (business), specifying parts of a business process * Standard operatin ...
that create and manipulate instances of that structure. The efficiency of a data structure cannot be analyzed separately from those operations. This observation motivates the theoretical concept of an
abstract data type In computer science, an abstract data type (ADT) is a mathematical model for data types. An abstract data type is defined by its behavior (Semantics (computer science), semantics) from the point of view of a ''user'', of the data, specifically in ...
, a data structure that is defined indirectly by the operations that may be performed on it, and the mathematical properties of those operations (including their space and time cost).


Examples

There are numerous types of data structures, generally built upon simpler
primitive data type In computer science Computer science deals with the theoretical foundations of information, algorithms and the architectures of its computation as well as practical techniques for their application. Computer science is the study of Algori ...
s. Well known examples are: * A ''
byte The byte is a unit of digital information that most commonly consists of eight bit The bit is a basic unit of information in computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It ...
'' is the smallest amount of data that a Computer CPU can copy from memory to a register or back in a single CPU instruction, therefore a bytestream is the most efficient way to run big data through a computer, hence Stream processing.
Ref
Ref
. No CPU can copy a single bit from memory to a register or back, because every bit in memory is part of a byte. * An ''array'' is a number of elements in a specific order, typically all of the same type (depending on the language, individual elements may either all be forced to be the same type, or may be of almost any type). Elements are accessed using an integer index to specify which element is required. Typical implementations allocate contiguous memory words for the elements of arrays (but this is not always a necessity). Arrays may be fixed-length or resizable. * A ''
linked list In , a linked list is a linear collection of data elements whose order is not given by their physical placement in memory. Instead, each element to the next. It is a consisting of a collection of s which together represent a . In its most basi ...

linked list
'' (also just called ''list'') is a linear collection of data elements of any type, called nodes, where each node has itself a value, and points to the next node in the linked list. The principal advantage of a linked list over an array is that values can always be efficiently inserted and removed without relocating the rest of the list. Certain other operations, such as
random access Random access (more precisely and more generally 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 ...
to a certain element, are however slower on lists than on arrays. * A ''record'' (also called ''tuple'' or ''struct'') is an
aggregate data Aggregate data is high-level data Data are units of information Information can be thought of as the resolution of uncertainty; it answers the question of "What an entity is" and thus defines both its essence and the nature of its cha ...
structure. A record is a value that contains other values, typically in fixed number and sequence and typically indexed by names. The elements of records are usually called ''fields'' or ''members''. * A ''union'' is a data structure that specifies which of a number of permitted primitive types may be stored in its instances, e.g. ''float'' or ''long integer''. Contrast with a record, which could be defined to contain a float ''and'' an integer; whereas in a union, there is only one value at a time. Enough space is allocated to contain the widest member data-type. * A ''
tagged unionIn computer science, a tagged union, also called a variant type, variant, variant record, choice type, discriminated union, disjoint union, sum type or coproduct, is a data structure used to hold a value that could take on several different, but fixe ...
'' (also called ''variant'', ''variant record'', ''discriminated union'', or ''disjoint union'') contains an additional field indicating its current type, for enhanced type safety. * An ''object'' is a data structure that contains data fields, like a record does, as well as various methods which operate on the data contents. An object is an in-memory instance of a class from a
taxonomy Taxonomy (general) is the practice and science of classification of things or concepts, including the principles that underlie such classification. The term may also refer to a specific classification scheme. Originally used only about biological ...

taxonomy
. In the context of
object-oriented programming Object-oriented programming (OOP) is a programming paradigm Programming paradigms are a way to classify programming languages based on their features. Languages can be classified into multiple paradigms. Some paradigms are concerned mainl ...
, records are known as
plain old data structure In geography, a plain is a flat expanse of land that generally does not change much in elevation. Plains occur as lowlands along valleys or on the doorsteps of mountains, as coastal plains, and as plateaus or Highland, uplands. In a valley, a pla ...
s to distinguish them from objects. In addition, '' hashes'', ''graphs'' and ''
binary trees In computer science Computer science deals with the theoretical foundations of information, algorithms and the architectures of its computation as well as practical techniques for their application. Computer science is the study of Algo ...
'' are other commonly used data structures.


Language support

Most
assembly language In computer programming Computer programming is the process of designing and building an executable computer program to accomplish a specific computing result or to perform a particular task. Programming involves tasks such as analysis, genera ...
s and some low-level languages, such as
BCPL BCPL ("Basic Combined Programming Language") is a procedural, imperative Imperative may refer to: *Imperative mood, a grammatical mood (or mode) expressing commands, direct requests, and prohibitions *Imperative programming, a programming pa ...
(Basic Combined Programming Language), lack built-in support for data structures. On the other hand, many
high-level programming language In computer science Computer science deals with the theoretical foundations of information, algorithms and the architectures of its computation as well as practical techniques for their application. Computer science is the study of , , ...
s and some higher-level assembly languages, such as
MASM The Microsoft Macro Assembler (MASM) is an x86 x86 is a family of instruction set architecture In computer science, an instruction set architecture (ISA), also called computer architecture, is an abstract model of a computer. A device t ...
, have special syntax or other built-in support for certain data structures, such as records and arrays. For example, the C (a direct descendant of BCPL) and
Pascal Pascal, Pascal's or PASCAL may refer to: People and fictional characters * Pascal (given name), including a list of people with the name * Pascal (surname), including a list of people and fictional characters with the name ** Blaise Pascal, French ...
languages support structs and records, respectively, in addition to vectors (one-dimensional
arrays ARRAY, also known as ARRAY Now, is an independent distribution company launched by film maker and former publicist Ava DuVernay in 2010 under the name African-American Film Festival Releasing Movement (AFFRM). In 2015 the company rebranded itself ...
) and multi-dimensional arrays. Most programming languages feature some sort of
library A library is a collection of materials, books or media that are easily accessible for use and not just for display purposes. It is responsible for housing updated information in order to meet the user's needs on a daily basis. A library provid ...
mechanism that allows data structure implementations to be reused by different programs. Modern languages usually come with standard libraries that implement the most common data structures. Examples are the
C++ C++ () is a general-purpose programming language In computer software, a general-purpose programming language is a programming language dedicated to a general-purpose, designed to be used for writing software in a wide variety of application ...

C++
Standard Template Library The Standard Template Library (STL) is a software library for the C++ programming language that influenced many parts of the C++ Standard Library. It provides four components called ''algorithm of an algorithm (Euclid's algorithm) for calcu ...
, the
Java Collections Framework The Java Java ( id, Jawa, ; jv, ꦗꦮ; su, ) is one of the islands of the Greater Sunda Islands in Indonesia Indonesia ( ), officially the Republic of Indonesia ( id, Republik Indonesia, links=yes ), is a country in Southeast Asia a ...
, and the
Microsoft Microsoft Corporation is an American multinational Multinational may refer to: * Multinational corporation, a corporate organization operating in multiple countries * Multinational force, a military body from multiple countries * Multinationa ...

Microsoft
.NET Framework. Modern languages also generally support
modular programming Modular programming is a software design technique that emphasizes separating the functionality of a Computer program, program into independent, interchangeable modules, such that each contains everything necessary to execute only one aspect of the ...
, the separation between the
interface Interface or interfacing may refer to: Academic journals * Interface (journal), ''Interface'' (journal), by the Electrochemical Society * ''Interface, Journal of Applied Linguistics'', now merged with ''ITL International Journal of Applied Lin ...
of a library module and its implementation. Some provide
opaque data type In computer science Computer science deals with the theoretical foundations of information, algorithms and the architectures of its computation as well as practical techniques for their application. Computer science is the study of Algori ...
s that allow clients to hide implementation details.
Object-oriented programming language Object-oriented programming (OOP) is a programming paradigm Programming paradigms are a way to classify programming languages based on their features. Languages can be classified into multiple paradigms. Some paradigms are concerned mainl ...
s, such as
C++ C++ () is a general-purpose programming language In computer software, a general-purpose programming language is a programming language dedicated to a general-purpose, designed to be used for writing software in a wide variety of application ...

C++
,
Java Java ( id, Jawa, ; jv, ꦗꦮ; su, ) is one of the Greater Sunda Islands The Greater Sunda Islands are four tropical islands situated within Southeast Asia, in the Pacific Ocean. The islands, Borneo, Java, Sulawesi and Sumatra, are internat ...
, and
Smalltalk Smalltalk is an , . Smalltalk was created as the language underpinning the "new world" of computing exemplified by "human–computer symbiosis". It was designed and created in part for al use, specifically for , at the Learning Research Group ...

Smalltalk
, typically use
classes Class or The Class may refer to: Common uses not otherwise categorized * Class (biology), a taxonomic rank * Class (knowledge representation), a collection of individuals or objects * Class (philosophy), an analytical concept used differently f ...
for this purpose. Many known data structures have
concurrent Concurrency, concurrent, or concurrence may refer to: * Concurrence, in jurisprudence, the need to prove both ''actus reus'' and ''mens rea'' * Concurring opinion In law, a concurring opinion is in certain legal systems a written opinion An opin ...
versions which allow multiple computing threads to access a single concrete instance of a data structure simultaneously.


See also

*
Abstract data type In computer science, an abstract data type (ADT) is a mathematical model for data types. An abstract data type is defined by its behavior (Semantics (computer science), semantics) from the point of view of a ''user'', of the data, specifically in ...
*
Concurrent data structure In computer science, a concurrent data structure is a particular way of storing and organizing data for access by multiple computing Thread (computer science), threads (or process (computing), processes) on a computer. Historically, such data st ...
*
Data model A data model (or datamodel) is an abstract model that organizes elements of data and standardizes how they relate to one another and to the properties of real-world entities. For instance, a data model may specify that the data element representing ...

Data model
*
DynamizationIn computer science Computer science deals with the theoretical foundations of information, algorithms and the architectures of its computation as well as practical techniques for their application. Computer science is the study of Algorith ...
*
Linked data structureIn computer science Computer science deals with the theoretical foundations of information, algorithms and the architectures of its computation as well as practical techniques for their application. Computer science is the study of Algorith ...
*
List of data structures This is a list of notable data structure Image:Hash table 3 1 1 0 1 0 0 SP.svg, 315px, A data structure known as a hash table. In computer science, a data structure is a data organization, management, and storage format that enables efficient ac ...
*
Persistent data structure In computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithmic processes and development of both computer hardware , hardware and softwa ...
*
Plain old data structure In geography, a plain is a flat expanse of land that generally does not change much in elevation. Plains occur as lowlands along valleys or on the doorsteps of mountains, as coastal plains, and as plateaus or Highland, uplands. In a valley, a pla ...
*
Queap
Queap
* Succinct data structure *
Tree (data structure) In computer science, a tree is a widely used abstract data type that simulates a hierarchical tree structure, with a root value and subtrees of children with a #Terminology, parent node, represented as a set of linked Node (computer science), no ...


References


Bibliography

* Peter Brass, ''Advanced Data Structures'',
Cambridge University Press Cambridge University Press (CUP) is the publishing business of the University of Cambridge , mottoeng = Literal: From here, light and sacred draughts. Non literal: From this place, we gain enlightenment and precious knowled ...
, 2008, *
Donald Knuth Donald Ervin Knuth ( ; born January 10, 1938) is an American computer scientist A computer scientist is a person A person (plural people or persons) is a being that has certain capacities or attributes such as reason, morality, consciousnes ...
, ''
The Art of Computer Programming ''The Art of Computer Programming'' (''TAOCP'') is a comprehensive monograph written by computer scientist Donald Knuth that covers many kinds of Computer programming, programming algorithms and analysis of algorithms, their analysis. Knuth began ...
'', vol. 1.
Addison-Wesley Addison-Wesley is a publisher of textbooks and computer literature. It is an Imprint (trade name), imprint of Pearson PLC, a global publishing and education company. In addition to publishing books, Addison-Wesley also distributes its technical titl ...
, 3rd edition, 1997, * Dinesh Mehta and
Sartaj Sahni Professor Sartaj Kumar Sahni (born July 22, 1949, in Pune Pune, known as Poona until 1978 ( ;), is the second-largest metropolitan city in the Indian State of Maharashtra Maharashtra (; , abbr. MH) is a state in the western peninsular reg ...

Sartaj Sahni
, ''Handbook of Data Structures and Applications'',
Chapman and Hall Chapman & Hall is an imprint owned by CRC Press The CRC Press, LLC is an American publishing group that specializes in producing technical books. Many of their books relate to engineering, science and mathematics. Their scope also includes books ...
/
CRC Press The CRC Press, LLC is an American publishing group that specializes in producing technical books. Many of their books relate to engineering Engineering is the use of scientific principles to design and build machines, structures, and ot ...
, 2004, *
Niklaus Wirth Niklaus Emil Wirth (born 15 February 1934) is a Swiss . He has designed several s, including , and pioneered several classic topics in software engineering. In 1984, he won the , generally recognized as the highest distinction in , for developin ...

Niklaus Wirth
, ''Algorithms and Data Structures'',
Prentice Hall Prentice Hall is an American major educational publisher owned by Savvas Learning Company. Prentice Hall publishes print and digital content for the 6–12 and higher-education market. Prentice Hall distributes its technical titles through th ...
, 1985,


Further reading

*
Alfred Aho Alfred Vaino Aho (born August 9, 1941) is a Canadian computer scientist A computer scientist is a person who has acquired the knowledge of computer science Computer science deals with the theoretical foundations of information, algorit ...
,
John Hopcroft John Edward Hopcroft (born October 7, 1939) is an American theoretical computer scientist. His textbooks on theory of computation (also known as the Cinderella book) and data structure Image:Hash table 3 1 1 0 1 0 0 SP.svg, 315px, A data stru ...
, and
Jeffrey Ullman Jeffrey David Ullman (born November 22, 1942) is an American computer scientist A computer scientist is a person who has acquired the knowledge of computer science Computer science deals with the theoretical foundations of information, ...
, ''Data Structures and Algorithms'', Addison-Wesley, 1983, *
G. H. Gonnet
G. H. Gonnet
and R. Baeza-Yates,
Handbook of Algorithms and Data Structures - in Pascal and C
', second edition, Addison-Wesley, 1991, *
Ellis Horowitz Ellis Horowitz is an American computer scientist A computer scientist is a person A person (plural people or persons) is a being that has certain capacities or attributes such as reason, morality, consciousness or self-consciousness, and be ...
and Sartaj Sahni, ''Fundamentals of Data Structures in Pascal'',
Computer Science Press W. H. Freeman and Company is an imprint (trade name), imprint of Macmillan Higher Education, a division of Macmillan Publishers. Macmillan publishes monographs and textbooks for the sciences under the imprint. History The company was founded in 19 ...
, 1984,


External links


Descriptions
from the
Dictionary of Algorithms and Data Structures The NIST Dictionary of Algorithms and Data Structures is a reference work maintained by the U.S. National Institute of Standards and Technology The National Institute of Standards and Technology (NIST) is a physical sciences laboratory and a ...

Data structures course

An Examination of Data Structures from .NET perspective

Schaffer, C. ''Data Structures and Algorithm Analysis''
{{DEFAULTSORT:Data Structure