Browse curriculum

Data Structures

Core Data Structures, Visualized

This is the largest topic in the curriculum, and the one where visualization pays off most. Pointer manipulation in a linked list, rotation in an AVL tree, relaxation in Dijkstra’s algorithm — these are all fundamentally spatial operations that textbooks are forced to render as prose.

The lessons run from the linear structures through trees and their balancing schemes to graphs and the traversal and shortest-path algorithms built on them. Together they cover the structures that the majority of interview questions are posed in terms of, and each one is something you can manipulate rather than only read about.

28

Interactive lessons

4

Free to open

6

Languages (JS, TS, Python, Java, C, C++)

Lessons

Data Structures lessons

Complexity

Data Structures time and space complexity compared

Best, average and worst-case running time and extra space for every data structures lesson, as each lesson derives them.

LessonBestAverageWorstSpace
StackO(1)O(1)O(1)O(n)
QueueO(1)O(1)O(1)O(n)
DequeO(1)O(1)O(1)O(N)
Circular QueueO(1)O(1)O(1)O(N)
Priority Queue (ADT)O(1) (Peek)O(log N) (Insert/Delete)O(log N) (Insert/Delete)O(N)
Tree TraversalO(n)O(n)O(n)O(w) or O(h)
Binary TreeO(1)O(n)O(n)O(n)
Binary Search TreeO(log n)O(log n)O(n)O(n)
AVL TreeO(log n)O(log n)O(log n)O(n)
Trie (Prefix Tree)O(L)O(L)O(L)O(N * L)
Segment TreeO(log n)O(log n)O(log n)O(n)
Fenwick TreeO(log N)O(log N)O(log N)O(N)
Red-Black TreeO(log n)O(log n)O(log n)O(n)
Singly Linked ListO(1)O(n)O(n)O(n)
Doubly Linked ListO(1)O(n)O(n)O(n)
Circular Linked ListO(1)O(n)O(n)O(n)
Graph RepresentationO(1)O(1)O(V)O(V + E)
Breadth First SearchO(V + E)O(V + E)O(V + E)O(V)
Depth First SearchO(V + E)O(V + E)O(V + E)O(V)
Topological SortO(V + E)O(V + E)O(V + E)O(V + E)
Cycle DetectionO(V + E)O(V + E)O(V + E)O(V)
Connected ComponentsO(V + E)O(V + E)O(V + E)O(V)
Bipartite GraphO(V + E)O(V + E)O(V + E)O(V)
Dijkstra's AlgorithmO(E log V)O(E log V)O(E log V)O(V + E)
Bellman-Ford AlgorithmO(E)O(VE)O(VE)O(V)
Minimum Spanning TreePrim: O(E log V) | Kruskal: O(E log E)Prim: O(E log V) | Kruskal: O(E log E)Prim: O(E log V) | Kruskal: O(E log E)O(V + E)
Floyd-Warshall AlgorithmO(V³)O(V³)O(V³)O(V²) (Matrix)
Bridges & Articulation PointsO(V + E)O(V + E)O(V + E)O(V) (DFS Stack + Arrays)
Curriculum

Continue the DSA curriculum

Data Structures is one of 12 topics in the interactive DSA visualizer curriculum. Once this topic is comfortable, the coding interview pattern library reorganises the same material around the patterns interview questions are built on.

Directory

Every other DSA visualizer