A data structure is a way of organizing data in a fashion that allows particular properties of that data to be queried and/or updated efficiently.
Data structures are ubiquitous in software. Hash tables, balanced trees, and dynamic arrays are essential building blocks for large, complicated systems and almost all programmers have encountered them at some point. More complicated structures like binary heaps can speed up complicated systems, while simpler concepts like stacks and queues make it possible to more elegantly and concisely encode algorithms.
Of course, this is just the tip of the iceberg when it comes to data structures. Theoreticians have been developing progressively better and better data structures over the past years, many of which are used extensively in modern software, and many are only useful from a theoretical perspective.
Data structures are closely related to algorithms. Often, a good choice of data structure can lead to a marked improvement in an algorithm's runtime. For example, Dijkstra's algorithm with a naive implementation of a priority queue runs in quadratic time, but with a fast Fibonacci heap can be shown to run in O(m + n lg n)
.
Below is a (not at all comprehensive) list of some of the more popular data structures and their variants:
- Dynamic arrays
- Dynamic table
- Tiered vector
- Hashed array tree
- Extendible array
- Linked lists
- Singly-linked lists
- Doubly-linked lists
- XOR-linked lists
- Skip lists
- Hash tables
- Chained hash tables
- Linear probing hash tables
- Quadratic probing hash tables
- Double hash tables
- Cuckoo hash tables
- Perfect hash tables
- Dynamic perfect hash tables
- Binary trees
- Red/black trees
- Interval trees
- Binary search trees
- Segment trees
- AVL trees
- AA trees
- Splay trees
- Scapegoat trees
- Treap
- Priority queues
- Binary heap
- Binomial heap
- Fibonacci heap
- van Emde Boas tree
- Skew binomial heap
- Brodal queue
- Radix trees
- Trie
- Patricia tree
- Ternary search tree
- Multiway trees
- B tree
- B+ tree
- B* tree
- Geometric trees
- Quadtree
- Octree
- kd-Tree
- BSP-tree
- R-tree
- Geometric structures
- Winged-edge
- Quadedge
- Network connectivity structures
- Disjoint-set forest
- Link/cut tree
- Top tree
- Graphs
- DAG
- Directed graph
- Undirected graph
- Hypergraph
Links: