Data Structures Fundamentals
Data structures are specialized formats for organizing and accessing data efficiently. Arrays, linked lists, trees, hash tables, graphs, and heaps each trade off between operation speeds, memory use, and complexity, and choosing the right one determines an algorithm's performance.
itComputer fundamentals | OpenSkills.info
Course pathWalk it in order
Look it upDip in anytime
Go furtherLeaves this page
Don't Panic
Don't Panic — Data Structures Fundamentals
A data structure is the arrangement that lets a program keep information without turning every request into a small archaeological dig. It does not solve the problem for you. It makes some operations convenient and makes other operations expensive, because storage has the audacity to occupy space and time.
The useful distinction is between an abstract data type, which says what operations exist, and an implementation, which says how memory supports them. A stack promises that the latest item comes out first. That promise can sit on an array or a linked structure. The rule stays put while the machinery changes beneath it, as rules tend to do.
Start with the workload. An array is comfortable with positions. A linked list is comfortable changing links near a node you already know. A hash table maps keys to positions and can make basic lookup fast on average, but it does not arrange keys in sorted order. Collisions are not a sign that the table has developed feelings; they are a normal consequence of mapping many possible keys into fewer positions.
Trees and heaps solve different kinds of urgency. A balanced search tree keeps keys ordered and limits height, so key operations remain logarithmic. A heap keeps only the parent-and-child order needed to expose the next minimum or maximum. It is a priority queue’s orderly waiting room, not a collection that has sorted every item out of sheer enthusiasm.
Graphs are for relationships that refuse to line up as one hierarchy. An adjacency list records the connections that exist and fits sparse graphs. An adjacency matrix reserves a position for every possible pair and can test one edge directly. Neither choice is a personality test. It is a cost profile.
The surprise is that Big O is necessary but not complete. It describes how cost grows, while memory use, iteration order, worst-case behavior, and implementation complexity still choose the winner. A supposedly fast lookup is not enough when the program needs sorted traversal. A quick insertion is not enough when locating the position takes most of the work.
Read the Intro when you need the full map and the definitions. Use Slides to compare the structures at a glance. Keep the Cheatsheet nearby when an operation profile needs a decision. Then use the practice session to write down the workload, test invariants after changes, and make the structures earn their place.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://xlinux.nist.gov/dads/terms.html
Supports
- NIST DADS defines algorithms, data structures, abstract data types, operations, and complexity terms
- Its indexes and cross-references connect related concepts
- https://xlinux.nist.gov/dads/HTML/dataStructure.html
Supports
- A data structure organizes information to support algorithm efficiency or conceptual unity
- Data structures have associated operations such as search, insertion, and balancing
- https://xlinux.nist.gov/dads/HTML/abstractDataType.html
Supports
- An abstract data type specifies values and operations independently of an implementation
- Stacks, queues, dictionaries, sets, and priority queues are abstract data types
- https://ocw.mit.edu/courses/6-006-introduction-to-algorithms-spring-2020/79a07dc1cb47d76dae2ffedc701e3d2b_MIT6_006S20_lec2.pdf
Supports
- An interface specifies supported operations while a data structure represents how to support them
- Sequence and set interfaces have distinct operation families
- Dynamic-array append is amortized constant time and growth can require copying items
- Static arrays provide constant-time indexed access while insertion and deletion can be linear
- Linked lists provide constant-time changes at known ends while indexed access is linear
- https://xlinux.nist.gov/dads/HTML/array.html
Supports
- Array items are directly accessible through integer indexes
- Middle insertion can take linear time
- https://xlinux.nist.gov/dads/HTML/linkedList.html
Supports
- A linked list stores each item with a link to the next item
- Ordinary linked-list search is linear
- Linked lists can implement stacks and queues
- https://xlinux.nist.gov/dads/HTML/stack.html
Supports
- A stack removes the most recently added item first
- Push, pop, top, and empty checks are core stack operations
- https://xlinux.nist.gov/dads/HTML/queue.html
Supports
- A queue removes the earliest added item first
- Enqueue adds at the tail and dequeue removes from the head
- https://xlinux.nist.gov/dads/HTML/dictionary.html
Supports
- A dictionary maps keys to values through insert, find, and delete operations
- Hash tables and search trees are dictionary implementations
- https://xlinux.nist.gov/dads/HTML/hashtab.html
Supports
- A hash table maps dictionary keys to array positions with a hash function
- Collisions occur when keys map to the same position
- Chaining and open addressing are collision-resolution families
- https://ocw.mit.edu/courses/6-006-introduction-to-algorithms-spring-2020/ce9e94705b914598ce78a00a70a1f734_MIT6_006S20_lec4.pdf
Supports
- Hashing maps keys into a smaller table and therefore permits collisions
- Chaining stores colliding items in another structure
- Hash tables can provide expected amortized constant-time dynamic set operations under stated assumptions
- Sorted arrays and ordered structures support order operations that hash tables do not make efficient
- https://xlinux.nist.gov/dads/HTML/tree.html
Supports
- A tree is accessed from a root and contains internal nodes, children, leaves, and subtrees
- Trees can represent rooted hierarchical relationships
- https://xlinux.nist.gov/dads/HTML/binarySearchTree.html
Supports
- A binary search tree keeps smaller keys in left subtrees and larger keys in right subtrees
- AVL trees are balanced binary-search-tree variants
- https://ocw.mit.edu/courses/6-006-introduction-to-algorithms-spring-2020/pages/lecture-notes/
Supports
- Binary-search-tree operations depend on height
- A tree can degenerate to linear height
- AVL balancing keeps height logarithmic and supports logarithmic key operations
- The course sequence includes heaps, graph traversal, and shortest paths after trees
- https://xlinux.nist.gov/dads/HTML/heap.html
Supports
- A heap is a complete tree with a parent-child key-order property
- Heaps are used to implement priority queues
- Heap memory and general allocation memory are different meanings of the word heap
- https://xlinux.nist.gov/dads/HTML/binaryheap.html
Supports
- A binary heap can be implemented in an array with computed parent and child indexes
- Binary-heap insertion is logarithmic
- https://ocw.mit.edu/courses/6-006-introduction-to-algorithms-spring-2020/40d4851e550507ca14dc778b9b2266cc_MIT6_006S20_lec8.pdf
Supports
- A complete binary tree can use an implicit array representation
- A priority queue can inspect its extreme item in constant time and insert or remove it in logarithmic time
- Arbitrary search in a binary heap can be linear
- https://xlinux.nist.gov/dads/HTML/adjacencyListRep.html
Supports
- An adjacency list stores an array of neighbor lists
- Adjacency lists are compact for sparse graphs
- https://xlinux.nist.gov/dads/HTML/adjacencyMatrixRep.html
Supports
- An adjacency matrix represents graph edges in a matrix indexed by vertex pairs
- A matrix supports direct access to the entry for a vertex pair
- https://opendsa.cs.vt.edu/OpenDSA/Books/Catalog/html/index.html
Supports
- OpenDSA provides instructional material on lists, stacks, queues, hashing, trees, heaps, graphs, and algorithm analysis
- Its materials include explanations, visualizations, and exercises
- https://opendsa.cs.vt.edu/ODSA/Books/CS3/html/genindex.html
Supports
- The index links definitions and instructional sections for core and advanced data-structure topics
- https://ocw.mit.edu/courses/6-006-introduction-to-algorithms-spring-2020/
Supports
- MIT 6.006 covers common algorithms, data structures, performance measures, and analysis
- The course provides lecture notes, videos, problems, quizzes, and solutions
- https://algs4.cs.princeton.edu/home/
Supports
- The booksite covers fundamentals, searching, graphs, strings, and applications
- It provides implementations, excerpts, exercises, visualizations, and programming assignments
- https://www.ibm.com/history/hans-peter-luhn
Supports
- Hans Peter Luhn developed an IBM hashing method in 1953.
- https://www-formal.stanford.edu/jmc/history/lisp/lisp.html
Supports
- John McCarthy describes the development of Lisp in the late 1950s and its list-processing foundations.
- https://doi.org/10.1016/0020-0190(62)90024-0
Supports
- Adelson-Velsky and Landis published their balanced-tree algorithm in 1962.
- https://doi.org/10.1145/512274.512284
Supports
- J. W. J. Williams published heapsort in 1964, using a heap to order records.
- https://www-cs-faculty.stanford.edu/~knuth/taocp.html
Supports
- The Art of Computer Programming began with Fundamental Algorithms in 1968 and organized core algorithm and data-structure analysis.
- https://doi.org/10.1109/FOCS.1978.16
Supports
- Guibas and Sedgewick presented a dichromatic framework for balanced search trees in 1978.
- https://doi.org/10.1145/3828.3835
Supports
- Sleator and Tarjan published self-adjusting binary search trees in 1985.
- https://www.sgi.com/tech/stl/
Supports
- The SGI Standard Template Library documentation presents generic containers, iterators, and algorithms that brought common data-structure interfaces into widespread C++ practice.
- https://baptiste-wicht.com/posts/2012/11/cpp-benchmark-vector-vs-list.html
Supports
- A C++ container benchmark reports that contiguous vector traversal can substantially outperform list traversal because of cache behavior.
- https://tylerayoung.com/2019/01/29/benchmarks-of-cache-friendly-data-structures-in-c/
Supports
- A practitioner benchmark compares cache-friendly C++ container designs and motivates measuring locality as well as asymptotic complexity.
