π§± Data Structures
Organizing data for efficient access. 52 topics, from beginner to advanced.
Data structures are the ways programs organize information in memory so it can be read, changed and searched efficiently. Arrays, linked lists, stacks, queues, trees, heaps, hash tables and graphs each make different operations fast and others slow. Choosing the right one is often the single biggest factor in a programβs speed.
Who this area is for
Learners who can write basic programs and now want to write faster, cleaner code, and anyone preparing for technical interviews.
Real-world use cases
- Using a hash table to look up users by ID in constant average time.
- Using a stack to track function calls or undo history.
- Using a heap to repeatedly get the highest-priority task in a scheduler.
- Choosing a priority queue for a job scheduler that always runs the most urgent task.
- Using a trie to power autocomplete in a search box.
Topics in Data Structures
Beginner (18)
- Arrays β Contiguous memory blocks giving constant-time indexed access.
- Dynamic Arrays β Resizable arrays that grow by reallocating with amortized cost.
- Linked Lists β Nodes chained by pointers allowing cheap insertion and removal.
- Doubly Linked Lists β Linked nodes with both next and previous pointers.
- Circular Linked Lists β Lists where the last node points back to the first.
- Stacks β Last-in first-out collection with push and pop.
- Queues β First-in first-out collection with enqueue and dequeue.
- Deque β Double-ended queue permitting insertion and removal at both ends.
- Priority Queue β Collection always yielding the element with highest priority first.
- Hash Tables β Structures mapping keys to buckets via a hash function.
- Hash Collisions β Situations where distinct keys map to the same slot.
- Chaining β Collision strategy storing colliding entries in per-bucket lists.
- Open Addressing β Collision strategy probing other slots in the table itself.
- Trees β Hierarchical structures of nodes with parent-child relationships.
- Binary Trees β Trees where each node has at most two children.
- Tree Traversals β Visiting nodes in preorder, inorder, postorder or level order.
- Binary Search Trees β Ordered binary trees with left smaller and right larger keys.
- AVL Trees β Self-balancing BSTs keeping subtree heights within one.
Intermediate (17)
- Red-Black Trees β Balanced BSTs using node colors to bound height.
- B-Trees β Wide balanced trees optimized for disk block access.
- B+ Trees β B-tree variant storing all data in linked leaves, common in databases.
- Heaps β Complete trees satisfying a parent-versus-child ordering property.
- Binary Heap Operations β Sift-up and sift-down procedures maintaining the heap invariant.
- Tries β Prefix trees storing strings character by character.
- Segment Trees β Trees answering range queries and updates in logarithmic time.
- Fenwick Trees β Compact structure for prefix sums with point updates.
- Graphs β Vertices connected by edges modeling relationships.
- Adjacency List β Graph storage keeping each vertex's neighbors in a list.
- Adjacency Matrix β Graph storage using a square grid marking edges.
- Disjoint Set Union β Structure tracking partitions with union and find operations.
- Path Compression β Flattening find paths to speed up disjoint sets.
- Skip Lists β Layered linked lists enabling probabilistic logarithmic search.
- Bloom Filters β Probabilistic set membership structure allowing false positives only.
- Splay Trees β Self-adjusting trees moving accessed nodes to the root.
- Treaps β Randomized trees combining BST order with heap priorities.
Advanced (17)
- Sparse Tables β Precomputed tables answering idempotent range queries in constant time.
- Suffix Arrays β Sorted array of all suffixes of a string.
- Suffix Trees β Compressed trie of all suffixes enabling fast substring queries.
- Interval Trees β Trees storing ranges to find overlaps efficiently.
- KD-Trees β Space-partitioning trees for multidimensional points.
- Quadtrees β Trees recursively dividing two-dimensional space into four regions.
- LRU Cache Structure β Hash map plus linked list evicting least recently used entries.
- Circular Buffer β Fixed-size ring storing streaming data with wrapping indices.
- Persistent Data Structures β Structures preserving previous versions after updates.
- Fibonacci Heaps β Heaps with amortized constant decrease-key operations.
- Van Emde Boas Trees β Structures supporting integer set operations in log-log time.
- Cuckoo Hashing β Hashing scheme with two tables guaranteeing constant lookup.
- Count-Min Sketch β Probabilistic frequency estimator using little memory.
- HyperLogLog β Probabilistic counter estimating distinct elements.
- Merkle Trees β Hash trees enabling efficient integrity verification.
- Rope Data Structure β Tree of string pieces for efficient large text editing.
- Union of Sets with Bitsets β Compact boolean arrays operating on many bits at once.
How to study Data Structures
For each structure, ask what the common operations cost and why. Implement a small version yourself, such as a stack or a hash table, before you use the built-in one. Use the Visual Lab stack, queue, BST and hash views to watch operations change the structure step by step.
Frequently asked questions
Array or linked list: which is better?
What is the difference between a stack and a queue?
When should I use a tree instead of a hash table?
Do I need to implement data structures from scratch?
Which data structure should I learn first?
Open the interactive Data Structures area Take the Data Structures quiz
Other areas
- π» Programming Fundamentals
- βοΈ Algorithms
- π Computer Architecture & Logic
- π₯οΈ Operating Systems
- π Computer Networks
- ποΈ Databases
- ποΈ Software Engineering
- πΈοΈ Web Development
- π Security & Cryptography
- β Theory & Discrete Math
- 𧬠Languages & Compilers
- π€ AI & Machine Learning
- βοΈ Distributed Systems & Cloud
- π¨ Graphics, Vision & Media
- π Math for Computing
- π Concurrency & Parallelism
- π± Mobile, Embedded & IoT
- π οΈ DevOps & Tooling
- π Emerging & Frontier Topics