Data Structures & Algorithms

Learn the fundamentals of computer science. Build each data structure and algorithm from scratch in C++.

New to DSA? Start by understanding Big O notation

Track Your DSA Progress

Create a free account to save your progress as you learn each data structure and algorithm

123
Total Topics
0
Completed
0
In Progress
0/38
Essential

Filters

Priority:
Difficulty:
Status:

Data Structures

Arrays

5 topics 2 available

E Beginner

Static Array

Fixed-size contiguous memory allocation with O(1) random access.

~30 min Start
E Beginner

Dynamic Array

Resizable array with amortized O(1) insertion at the end. Foundation of std::vector.

Requires: Static Array
~60 min Start
I Beginner

Circular Array

Array with wrap-around indexing, commonly used for circular buffers.

Requires: Dynamic Array
~45 min Coming Soon
S Intermediate

Bit Array

Space-efficient array storing individual bits, useful for flags and sets.

Requires: Static Array
~60 min Coming Soon
S Intermediate

Sparse Array

Efficient storage for arrays with mostly default values.

Requires: Dynamic Array, Hash Table (Chaining)
~60 min Coming Soon

Linked Lists

6 topics 1 available

E Beginner

Singly Linked List

Linear data structure with nodes containing data and a next pointer.

Requires: Dynamic Array
~90 min Start
E Beginner

Doubly Linked List

Linked list with both next and previous pointers for bidirectional traversal.

Requires: Singly Linked List
~60 min Coming Soon
I Beginner

Circular Linked List

Linked list where the last node points back to the first.

Requires: Singly Linked List
~45 min Coming Soon
S Intermediate

Skip List

Probabilistic data structure with multiple levels for O(log n) search.

Requires: Singly Linked List
~120 min Coming Soon
N Advanced

XOR Linked List

Memory-efficient doubly linked list using XOR of addresses.

Requires: Doubly Linked List
~60 min Coming Soon
N Intermediate

Unrolled Linked List

Linked list where each node contains an array of elements for better cache performance.

Requires: Singly Linked List, Dynamic Array
~75 min Coming Soon

Stacks & Queues

6 topics

E Beginner

Stack

LIFO (Last In First Out) data structure with push and pop operations.

Requires: Dynamic Array
~45 min Coming Soon
E Beginner

Queue

FIFO (First In First Out) data structure with enqueue and dequeue operations.

Requires: Dynamic Array
~45 min Coming Soon
I Beginner

Deque

Double-ended queue supporting insertion and deletion at both ends.

Requires: Queue
~60 min Coming Soon
E Intermediate

Priority Queue

Queue where elements are dequeued based on priority rather than arrival order.

Requires: Binary Heap
~60 min Coming Soon
I Intermediate

Monotonic Stack

Stack maintaining monotonic order, useful for next greater element problems.

Requires: Stack
~60 min Coming Soon
I Intermediate

Monotonic Queue

Deque maintaining monotonic order for sliding window maximum/minimum.

Requires: Deque
~60 min Coming Soon

Hash-based Structures

8 topics

E Intermediate

Hash Table (Chaining)

Hash table using separate chaining to handle collisions with linked lists.

Requires: Singly Linked List, Dynamic Array
~120 min Coming Soon
I Intermediate

Hash Table (Open Addressing)

Hash table using probing techniques to handle collisions.

Requires: Hash Table (Chaining)
~90 min Coming Soon
E Intermediate

Hash Set

Collection of unique elements with O(1) average lookup.

Requires: Hash Table (Chaining)
~60 min Coming Soon
E Intermediate

Hash Map

Key-value store with O(1) average insertion and lookup.

Requires: Hash Table (Chaining)
~60 min Coming Soon
S Advanced

Bloom Filter

Space-efficient probabilistic data structure for membership testing.

Requires: Hash Table (Chaining)
~90 min Coming Soon
N Advanced

Cuckoo Filter

Improved bloom filter supporting deletion with better space efficiency.

Requires: Bloom Filter
~90 min Coming Soon
N Advanced

Count-Min Sketch

Probabilistic data structure for frequency estimation in data streams.

Requires: Hash Table (Chaining)
~75 min Coming Soon
N Advanced

HyperLogLog

Probabilistic algorithm for cardinality estimation with minimal memory.

Requires: Hash Table (Chaining)
~90 min Coming Soon

Trees

18 topics

E Intermediate

Binary Tree

Hierarchical data structure where each node has at most two children.

Requires: Singly Linked List
~90 min Coming Soon
E Intermediate

Binary Search Tree

Binary tree maintaining ordering property for efficient search operations.

Requires: Binary Tree
~120 min Coming Soon
E Advanced

AVL Tree

Self-balancing BST maintaining height balance with rotations.

Requires: Binary Search Tree
~180 min Coming Soon
E Advanced

Red-Black Tree

Self-balancing BST using color properties. Used in std::map and std::set.

Requires: Binary Search Tree
~240 min Coming Soon
S Advanced

Splay Tree

Self-adjusting BST that moves recently accessed elements to the root.

Requires: Binary Search Tree
~120 min Coming Soon
S Advanced

Treap

Randomized BST combining tree and heap properties.

Requires: Binary Search Tree, Binary Heap
~120 min Coming Soon
I Advanced

B-Tree

Self-balancing tree optimized for disk access, used in databases and file systems.

Requires: Binary Search Tree
~180 min Coming Soon
I Advanced

B+ Tree

B-tree variant with all data in leaves, linked for range queries.

Requires: B-Tree
~120 min Coming Soon
E Advanced

Trie

Prefix tree for efficient string storage and retrieval.

Requires: Binary Tree
~120 min Coming Soon
S Advanced

Radix Tree

Compressed trie where single-child nodes are merged.

Requires: Trie
~90 min Coming Soon
S Advanced

Suffix Tree

Trie of all suffixes of a string for fast pattern matching.

Requires: Trie
~180 min Coming Soon
I Advanced

Segment Tree

Tree for efficient range queries and point updates.

Requires: Binary Tree
~150 min Coming Soon
I Advanced

Fenwick Tree

Binary indexed tree for efficient prefix sums and updates.

Requires: Dynamic Array
~120 min Coming Soon
S Advanced

Interval Tree

Tree for storing intervals and querying overlaps.

Requires: Binary Search Tree
~120 min Coming Soon
S Advanced

K-D Tree

Space-partitioning tree for organizing points in k-dimensional space.

Requires: Binary Search Tree
~150 min Coming Soon
S Advanced

Quadtree

Tree where each node has exactly four children, used for 2D spatial data.

Requires: Binary Tree
~120 min Coming Soon
N Advanced

Octree

Tree where each node has eight children, used for 3D spatial data.

Requires: Quadtree
~120 min Coming Soon
N Advanced

R-Tree

Tree for indexing spatial objects using minimum bounding rectangles.

Requires: B-Tree
~150 min Coming Soon

Heaps

7 topics

E Intermediate

Binary Heap

Complete binary tree satisfying heap property. Foundation of priority queues.

Requires: Binary Tree
~90 min Coming Soon
S Intermediate

D-ary Heap

Generalization of binary heap where each node has d children.

Requires: Binary Heap
~60 min Coming Soon
S Advanced

Fibonacci Heap

Heap with amortized O(1) decrease-key, optimal for Dijkstra.

Requires: Binary Heap
~180 min Coming Soon
S Advanced

Binomial Heap

Heap composed of binomial trees supporting efficient merge.

Requires: Binary Heap
~120 min Coming Soon
N Advanced

Pairing Heap

Simple heap with good practical performance and easy implementation.

Requires: Binary Heap
~90 min Coming Soon
N Advanced

Leftist Heap

Heap biased to the left for efficient merging operations.

Requires: Binary Heap
~90 min Coming Soon
N Advanced

Skew Heap

Self-adjusting heap with unconditional swapping during merge.

Requires: Binary Heap
~75 min Coming Soon

Graphs

5 topics

E Intermediate

Graph (Adjacency List)

Graph representation using lists of neighbors for each vertex.

Requires: Singly Linked List, Dynamic Array
~90 min Coming Soon
I Intermediate

Graph (Adjacency Matrix)

Graph representation using a 2D matrix for edge connections.

Requires: Dynamic Array
~60 min Coming Soon
E Intermediate

Weighted Graph

Graph where edges have associated weights or costs.

Requires: Graph (Adjacency List)
~60 min Coming Soon
I Intermediate

Directed Acyclic Graph

Directed graph with no cycles, used for dependencies and scheduling.

Requires: Graph (Adjacency List)
~60 min Coming Soon
E Advanced

Disjoint Set Union

Data structure for tracking disjoint sets with efficient union and find.

Requires: Dynamic Array
~90 min Coming Soon

Advanced Structures

6 topics

E Advanced

LRU Cache

Cache that evicts least recently used items when full.

Requires: Doubly Linked List, Hash Map
~120 min Coming Soon
I Advanced

LFU Cache

Cache that evicts least frequently used items when full.

Requires: LRU Cache
~150 min Coming Soon
S Advanced

Suffix Array

Sorted array of all suffixes for efficient string operations.

Requires: Dynamic Array
~150 min Coming Soon
N Advanced

Rope

Binary tree for efficient string concatenation and manipulation.

Requires: Binary Tree
~120 min Coming Soon
N Intermediate

Gap Buffer

Array with a gap for efficient insertions at cursor position.

Requires: Dynamic Array
~75 min Coming Soon
N Advanced

Piece Table

Data structure for text editing using original and add buffers.

Requires: Dynamic Array
~120 min Coming Soon

Algorithms

Searching

7 topics

E Beginner

Linear Search

Sequential search through all elements. O(n) time complexity.

Requires: Dynamic Array
~30 min Coming Soon
E Beginner

Binary Search

Divide and conquer search on sorted data. O(log n) time complexity.

Requires: Dynamic Array
~45 min Coming Soon
E Intermediate

Binary Search (Advanced)

Lower/upper bound, rotated arrays, and other variations.

Requires: Binary Search
~60 min Coming Soon
S Intermediate

Ternary Search

Search for maximum/minimum in unimodal functions.

Requires: Binary Search
~45 min Coming Soon
N Intermediate

Jump Search

Block-based search with O(sqrt(n)) time complexity.

Requires: Binary Search
~30 min Coming Soon
N Intermediate

Interpolation Search

Binary search variant using value distribution for probe position.

Requires: Binary Search
~45 min Coming Soon
N Intermediate

Exponential Search

Search for unbounded arrays by finding range then binary search.

Requires: Binary Search
~30 min Coming Soon

Sorting

12 topics

I Beginner

Bubble Sort

Simple comparison sort by repeatedly swapping adjacent elements.

Requires: Dynamic Array
~45 min Coming Soon
I Beginner

Selection Sort

Sort by repeatedly selecting the minimum element.

Requires: Dynamic Array
~45 min Coming Soon
I Beginner

Insertion Sort

Build sorted array by inserting elements in correct position.

Requires: Dynamic Array
~45 min Coming Soon
E Intermediate

Merge Sort

Divide and conquer sort with guaranteed O(n log n) performance.

Requires: Recursion Basics, Dynamic Array
~90 min Coming Soon
E Intermediate

Quick Sort

Efficient divide and conquer sort using partitioning.

Requires: Recursion Basics, Dynamic Array
~90 min Coming Soon
I Intermediate

Heap Sort

Sort using heap data structure with O(n log n) guarantee.

Requires: Binary Heap
~60 min Coming Soon
I Intermediate

Counting Sort

Non-comparison integer sort with O(n+k) time complexity.

Requires: Dynamic Array
~45 min Coming Soon
I Intermediate

Radix Sort

Non-comparison sort processing digits from least to most significant.

Requires: Counting Sort
~60 min Coming Soon
S Intermediate

Bucket Sort

Distribution sort using buckets for ranges of values.

Requires: Dynamic Array, Insertion Sort
~60 min Coming Soon
N Intermediate

Shell Sort

Generalized insertion sort with diminishing gap sequence.

Requires: Insertion Sort
~60 min Coming Soon
S Advanced

Tim Sort

Hybrid sort combining merge sort and insertion sort. Used in Python/Java.

Requires: Merge Sort, Insertion Sort
~120 min Coming Soon
S Advanced

Intro Sort

Hybrid sort switching between quicksort, heapsort, and insertion sort.

Requires: Quick Sort, Heap Sort
~90 min Coming Soon

Graph Algorithms

17 topics

E Intermediate

Breadth-First Search

Graph traversal exploring all neighbors before going deeper.

Requires: Graph (Adjacency List), Queue
~90 min Coming Soon
E Intermediate

Depth-First Search

Graph traversal exploring as far as possible before backtracking.

Requires: Graph (Adjacency List), Stack
~90 min Coming Soon
E Intermediate

Tree Traversals

Inorder, preorder, postorder, and level-order tree traversals.

Requires: Binary Tree
~90 min Coming Soon
E Intermediate

Topological Sort

Linear ordering of vertices in a DAG respecting dependencies.

Requires: Depth-First Search
~90 min Coming Soon
E Advanced

Dijkstra Algorithm

Shortest path algorithm for graphs with non-negative weights.

Requires: Weighted Graph, Priority Queue
~120 min Coming Soon
I Advanced

Bellman-Ford Algorithm

Shortest path algorithm handling negative edge weights.

Requires: Weighted Graph
~90 min Coming Soon
I Advanced

Floyd-Warshall Algorithm

All-pairs shortest path using dynamic programming.

Requires: Graph (Adjacency Matrix)
~90 min Coming Soon
I Advanced

A* Search

Informed search algorithm using heuristics for pathfinding.

Requires: Dijkstra Algorithm
~150 min Coming Soon
I Advanced

Prim Algorithm

Greedy algorithm for finding minimum spanning tree.

Requires: Weighted Graph, Priority Queue
~90 min Coming Soon
I Advanced

Kruskal Algorithm

MST algorithm using union-find and sorted edges.

Requires: Weighted Graph, Disjoint Set Union
~90 min Coming Soon
S Advanced

Tarjan SCC Algorithm

Find strongly connected components using DFS.

Requires: Depth-First Search
~120 min Coming Soon
S Advanced

Kosaraju Algorithm

Two-pass DFS algorithm for finding SCCs.

Requires: Depth-First Search
~90 min Coming Soon
S Advanced

Articulation Points

Find vertices whose removal disconnects the graph.

Requires: Depth-First Search
~90 min Coming Soon
S Advanced

Bridges

Find edges whose removal disconnects the graph.

Requires: Articulation Points
~75 min Coming Soon
S Advanced

Network Flow (Ford-Fulkerson)

Find maximum flow in a flow network.

Requires: Breadth-First Search, Weighted Graph
~180 min Coming Soon
N Advanced

Edmonds-Karp Algorithm

Ford-Fulkerson implementation using BFS for O(VE^2) guarantee.

Requires: Network Flow (Ford-Fulkerson)
~90 min Coming Soon
N Advanced

Dinic Algorithm

Efficient max flow algorithm using blocking flows.

Requires: Network Flow (Ford-Fulkerson)
~120 min Coming Soon

String Algorithms

6 topics

I Advanced

KMP Algorithm

Linear time pattern matching using failure function.

Requires: Dynamic Array
~120 min Coming Soon
I Advanced

Rabin-Karp Algorithm

Pattern matching using rolling hash for multiple pattern search.

Requires: Hash Table (Chaining)
~90 min Coming Soon
S Advanced

Boyer-Moore Algorithm

Pattern matching with bad character and good suffix heuristics.

Requires: Dynamic Array
~120 min Coming Soon
S Advanced

Z Algorithm

Linear time algorithm computing Z-array for pattern matching.

Requires: Dynamic Array
~90 min Coming Soon
S Advanced

Aho-Corasick Algorithm

Multi-pattern string matching using automaton.

Requires: Trie, Breadth-First Search
~150 min Coming Soon
S Advanced

Manacher Algorithm

Linear time algorithm for finding all palindromic substrings.

Requires: Dynamic Array
~90 min Coming Soon

Dynamic Programming

6 topics

E Beginner

Recursion Basics

Foundation of recursive problem solving.

~60 min Coming Soon
E Intermediate

DP Introduction

Introduction to dynamic programming with memoization and tabulation.

Requires: Recursion Basics
~120 min Coming Soon
E Advanced

DP Classic Problems

Classic DP problems: Fibonacci, Knapsack, LCS, LIS, Edit Distance.

Requires: DP Introduction
~180 min Coming Soon
S Advanced

DP on Trees

Dynamic programming techniques on tree structures.

Requires: DP Introduction, Binary Tree
~150 min Coming Soon
S Advanced

DP with Bitmask

DP using bitmasks for state compression.

Requires: DP Introduction
~120 min Coming Soon
N Advanced

DP Optimization

Advanced DP optimization techniques.

Requires: DP Classic Problems
~180 min Coming Soon

Algorithmic Techniques

7 topics

E Beginner

Two Pointer Technique

Efficient technique for array problems using two pointers.

Requires: Dynamic Array
~60 min Coming Soon
E Beginner

Sliding Window

Technique for subarray/substring problems with fixed or variable window.

Requires: Dynamic Array
~60 min Coming Soon
E Intermediate

Backtracking

Systematic way to iterate through all possible configurations.

Requires: Recursion Basics
~90 min Coming Soon
I Intermediate

Quick Select

Find kth smallest element in O(n) average time.

Requires: Quick Sort
~60 min Coming Soon
E Intermediate

Divide and Conquer

Problem-solving paradigm of breaking problems into subproblems.

Requires: Recursion Basics
~90 min Coming Soon
E Intermediate

Greedy Algorithms

Making locally optimal choices hoping for global optimum.

~90 min Coming Soon
I Intermediate

Bit Manipulation

Techniques for manipulating individual bits efficiently.

~90 min Coming Soon

Computational Geometry

3 topics

S Advanced

Convex Hull

Find smallest convex polygon containing all points.

Requires: Dynamic Array
~120 min Coming Soon
S Advanced

Line Intersection

Determine if and where two line segments intersect.

~60 min Coming Soon
N Advanced

Sweep Line Algorithm

Process geometric objects by sweeping a line across the plane.

Requires: Binary Search Tree
~120 min Coming Soon

Mathematical Algorithms

4 topics

I Beginner

Euclidean GCD

Efficient algorithm for computing greatest common divisor.

Requires: Recursion Basics
~30 min Coming Soon
I Beginner

Sieve of Eratosthenes

Efficient algorithm for finding all primes up to n.

Requires: Dynamic Array
~45 min Coming Soon
I Intermediate

Modular Arithmetic

Arithmetic operations under modulo for large numbers.

~60 min Coming Soon
N Advanced

Fast Fourier Transform

Efficient algorithm for polynomial multiplication.

Requires: Recursion Basics
~180 min Coming Soon