# walkccc/clrs

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/walkccc-clrs).**

5,060 stars · 1,284 forks · Markdown · mit

## Links

- GitHub: https://github.com/walkccc/CLRS
- Homepage: https://walkccc.me/CLRS
- awesome-repositories: https://awesome-repositories.com/repository/walkccc-clrs.md

## Topics

`clrs` `introduction-to-algorithms` `solutions`

## Description

This repository is a comprehensive collection of fully worked solutions to exercises and problems from the standard algorithms textbook by Cormen, Leiserson, Rivest, and Stein (CLRS). It serves as an educational reference for algorithm design and analysis, providing step-by-step reasoning, pseudocode, and mathematical proofs for a wide range of topics.

The content spans core computer science areas: algorithm analysis with asymptotic notation, recurrence solving, and amortized cost analysis; data structure implementation and operations for binary search trees, red-black trees, B-trees, Fibonacci heaps, hash tables, and more; graph algorithms covering traversal, shortest paths, minimum spanning trees, connectivity, and topological sorting; dynamic programming and greedy approaches for optimization problems; plus sorting, order statistics, and string/sequence algorithms.

The site is built as a static website using Markdown-driven content with KaTeX-rendered mathematical notation, organized via file-based routing for easy browsing of solutions by chapter and exercise.

## Tags

### Part of an Awesome List

- [Textbook Exercise Solutions](https://awesome-repositories.com/f/awesome-lists/learning/algorithm-solutions/textbook-exercise-solutions.md) — Providing fully worked solutions to exercises and problems from the CLRS algorithms textbook with step-by-step reasoning and pseudocode.
- [Free-List Allocators](https://awesome-repositories.com/f/awesome-lists/devtools/memory-allocators/memory-allocation-strategies/free-list-allocators.md) — Implements allocation and deallocation of array objects from a stack-like free list for reuse. ([source](https://walkccc.github.io/CLRS/Chap10/10.3/))

### Education & Learning Resources

- [Exercise Solutions](https://awesome-repositories.com/f/education-learning-resources/exercise-solutions.md) — Provides fully worked solutions to CLRS textbook exercises and problems with KaTeX notation. ([source](https://walkccc.github.io/CLRS/Chap07/Problems/7-4/))
- [Worked Solutions](https://awesome-repositories.com/f/education-learning-resources/textbooks/worked-solutions.md) — A collection of fully worked solutions to exercises and problems from the standard algorithms textbook by Cormen, Leiserson, Rivest, and Stein.
- [Algorithm and Data Structure Guides](https://awesome-repositories.com/f/education-learning-resources/algorithm-and-data-structure-guides.md) — A reference that provides detailed answers and derivations for topics like sorting, graph algorithms, dynamic programming, and advanced data structures.
- [Dynamic Programming](https://awesome-repositories.com/f/education-learning-resources/dynamic-programming.md) — Contains a wide range of DP solutions including knapsack, activity selection, and rod cutting. ([source](https://walkccc.github.io/CLRS/Chap15/Problems/15-6/))
- [Graph Traversal Algorithms](https://awesome-repositories.com/f/education-learning-resources/educational-resources/algorithms-theory-academics/cs-theory-foundations/algorithms/data-ordering-and-retrieval/graph-traversal-algorithms.md) — Covers BFS and DFS implementations with timing, edge classification, and bipartiteness detection. ([source](https://walkccc.github.io/CLRS/Chap22/22.3/))
- [Algorithm Implementations](https://awesome-repositories.com/f/education-learning-resources/educational-resources/algorithms-theory-academics/cs-theory-foundations/algorithms/general-collections-and-study/algorithm-implementations.md) — Provides pseudocode implementations and step-by-step execution traces of fundamental algorithms. ([source](https://walkccc.github.io/CLRS/Chap02/2.3/))
- [Red-Black Trees](https://awesome-repositories.com/f/education-learning-resources/educational-resources/algorithms-theory-academics/cs-theory-foundations/data-structure-implementations/data-structures/balanced-search-trees/red-black-trees.md) — Covers join, amortized cost, properties, and deletion fixup for red-black trees. ([source](https://walkccc.github.io/CLRS/Chap13/Problems/13-2/))
- [Algorithm Analysis](https://awesome-repositories.com/f/education-learning-resources/graph-theory-algorithms/algorithm-analysis.md) — Analyzing graph algorithms such as BFS, DFS, shortest paths, minimum spanning trees, and network flow with proofs of correctness and complexity.
- [Greedy Algorithms](https://awesome-repositories.com/f/education-learning-resources/greedy-algorithms.md) — Covers optimal prefix codes, activity selection, matroid scheduling, and coin change with optimality proofs. ([source](https://walkccc.github.io/CLRS/Chap16/16.3/))
- [Dynamic Programming Strategies](https://awesome-repositories.com/f/education-learning-resources/greedy-algorithms/dynamic-programming-strategies.md) — Solving optimization problems with dynamic programming or greedy strategies, including proofs of optimal substructure and exchange arguments.
- [Stack and Queue Algorithms](https://awesome-repositories.com/f/education-learning-resources/stack-and-queue-algorithms.md) — Provides overflow/underflow detection, double-ended array implementation, two stacks in one array, and simulation of queue with two stacks and stack with two queues. ([source](https://walkccc.github.io/CLRS/Chap10/10.1/))
- [Computer Science Education](https://awesome-repositories.com/f/education-learning-resources/technical-domain-education/computer-science-education.md) — An educational resource that helps students and professionals understand algorithm design and analysis through clear, annotated solutions.
- [Recurrence Relation Solving](https://awesome-repositories.com/f/education-learning-resources/technical-domain-education/computer-science-education/algorithmic-problem-solving/recursive-problem-solving/recurrence-relation-solving.md) — Solves recurrence relations using master theorem, recursion tree, and substitution method. ([source](https://walkccc.github.io/CLRS/Chap04/Problems/4-3/))
- [AVL Tree Operations](https://awesome-repositories.com/f/education-learning-resources/educational-resources/algorithms-theory-academics/cs-theory-foundations/data-structure-implementations/data-structures/balanced-search-trees/avl-tree-operations.md) — Maintains height balance in a BST after insertions by performing single rotations to keep subtree heights within one. ([source](https://walkccc.github.io/CLRS/Chap13/Problems/13-3/))
- [Stable Sorting Preservations](https://awesome-repositories.com/f/education-learning-resources/technical-domain-education/computer-science-education/computer-science-concepts/sorting-algorithms/stable-sorting-preservations.md) — Augments a non-stable sort with original indices to preserve relative order of equal elements. ([source](https://walkccc.github.io/CLRS/Chap08/8.3/))

### Data & Databases

- [Hash Tables](https://awesome-repositories.com/f/data-databases/hash-tables.md) — Covers direct-address dictionaries and amortized analysis of dynamic table expansion and contraction. ([source](https://walkccc.github.io/CLRS/Chap11/11.1/))
- [B-Tree](https://awesome-repositories.com/f/data-databases/storage-engines/b-tree.md) — Provides search, insertion, deletion, and predecessor operations in B-trees while preserving balance. ([source](https://walkccc.github.io/CLRS/Chap18/18.2/))
- [Dynamic Data Structures](https://awesome-repositories.com/f/data-databases/dynamic-data-structures.md) — Covers minimum gap maintenance in dynamic sets, node depth tracking, and insertion into sorted arrays. ([source](https://walkccc.github.io/CLRS/Chap14/14.3/))

### DevOps & Infrastructure

- [Amortized Cost Analyses](https://awesome-repositories.com/f/devops-infrastructure/resource-cost-management/amortized-cost-analyses.md) — Demonstrates amortized analysis using aggregate analysis and accounting method to bound operation costs. ([source](https://walkccc.github.io/CLRS/Chap17/17.1/))

### Programming Languages & Runtimes

- [Binary Search Trees](https://awesome-repositories.com/f/programming-languages-runtimes/programming-utilities/data-structure-type-helpers/data-structures/hierarchical-tree-structures/binary-search-trees.md) — Covers insertion, search, deletion, traversal, rotation, property analysis, and counting of binary search trees. ([source](https://walkccc.github.io/CLRS/Chap20/20.1/))

### Scientific & Mathematical Computing

- [Educational Implementations](https://awesome-repositories.com/f/scientific-mathematical-computing/data-structure-implementations/educational-implementations.md) — Implementing and analyzing fundamental data structures including binary search trees, red-black trees, heaps, hash tables, and B-trees.
- [Algorithm Analysis](https://awesome-repositories.com/f/scientific-mathematical-computing/numerical-mathematical-foundations/algorithms-and-complexity/algorithm-analysis.md) — Compares asymptotic running times and analyzes modifications to determine efficiency changes. ([source](https://walkccc.github.io/CLRS/Chap02/2.3/))
- [Asymptotic Notations](https://awesome-repositories.com/f/scientific-mathematical-computing/numerical-mathematical-foundations/algorithms-and-complexity/algorithm-analysis/asymptotic-notations.md) — Verifies properties and compares growth rates of big-O, theta, and omega notations using proofs. ([source](https://walkccc.github.io/CLRS/Chap03/Problems/3-4/))
- [Correctness Proofs](https://awesome-repositories.com/f/scientific-mathematical-computing/numerical-mathematical-foundations/algorithms-and-complexity/algorithm-analysis/correctness-proofs.md) — Provides formal proofs of algorithm correctness using invariants and induction. ([source](https://walkccc.github.io/CLRS/Chap07/Problems/7-1/))
- [Minimum Spanning Tree Algorithms](https://awesome-repositories.com/f/scientific-mathematical-computing/numerical-mathematical-foundations/algorithms-and-complexity/algorithms/graph-processing/minimum-spanning-tree-algorithms.md) — Covers MST algorithms including bottleneck spanning tree, preprocessing, and correctness verification. ([source](https://walkccc.github.io/CLRS/Chap23/Problems/23-3/))
- [Shortest Path Algorithms](https://awesome-repositories.com/f/scientific-mathematical-computing/shortest-path-algorithms.md) — Provides Bellman-Ford, DAG longest path, all-pairs shortest paths, and mean-weight cycle algorithms. ([source](https://walkccc.github.io/CLRS/Chap24/Problems/24-3/))
- [Probabilistic Analyses](https://awesome-repositories.com/f/scientific-mathematical-computing/numerical-mathematical-foundations/algorithms-and-complexity/algorithm-analysis/probabilistic-analyses.md) — Applies probabilistic methods to analyze randomized algorithms such as random permutations and chip testing. ([source](https://walkccc.github.io/CLRS/Chap05/5.3/))
- [Order Statistics](https://awesome-repositories.com/f/scientific-mathematical-computing/order-statistics.md) — Augments balanced BSTs with subtree sizes to support rank queries, order-statistic selection, and range enumeration. ([source](https://walkccc.github.io/CLRS/Chap14/14.1/))

### Software Engineering & Architecture

- [Fibonacci](https://awesome-repositories.com/f/software-engineering-architecture/heaps/fibonacci.md) — Covers decrease-key, pruning operations, and amortized cost analysis for Fibonacci heaps. ([source](https://walkccc.github.io/CLRS/Chap19/19.3/))
- [String and Sequence Algorithm Solutions](https://awesome-repositories.com/f/software-engineering-architecture/string-processing-algorithms/longest-common-substring-algorithms/string-and-sequence-algorithm-solutions.md) — Provides DP-based solutions for edit distance, longest common subsequence, longest increasing subsequence, optimal string break points, and paragraph line breaking. ([source](https://walkccc.github.io/CLRS/Chap15/Problems/15-5/))
- [Interval Tree Operations](https://awesome-repositories.com/f/software-engineering-architecture/interval-overlap-detection/interval-tree-operations.md) — Provides detection, search for exact and open intervals, enumeration of overlapping intervals, and maintenance of max attribute during rotations. ([source](https://walkccc.github.io/CLRS/Chap14/14.3/))
- [Linked List Manipulation Utilities](https://awesome-repositories.com/f/software-engineering-architecture/linked-lists/linked-list-manipulation-utilities.md) — Compares asymptotic running times for operations on singly, doubly, and circular linked lists and implements in-place compaction. ([source](https://walkccc.github.io/CLRS/Chap10/Problems/10-1/))
- [Sorting Algorithm Variants](https://awesome-repositories.com/f/software-engineering-architecture/sorting-algorithms/sorting-algorithm-variants.md) — Analyzes and implements variations of sorting algorithms including hybrid sort thresholds, three-way partitioning, insertion sort in descending order, and specific constraints. ([source](https://walkccc.github.io/CLRS/Chap02/Problems/2-1/))
