mcpField
C
clrs-algorithms

clrs-algorithms

github.com/grndlvlDevelopment1779 installsUpdated 38w ago
Repository

About clrs-algorithms

clrs-algorithms is a language-agnostic reference skill for data structures and algorithms based on CLRS. It helps developers choose structures, compare complexity, and adapt pseudocode to their programming language.

Key features

  1. 01Data structure decision guides
  2. 02Big-O complexity reference
  3. 03Pseudocode for implementation
  4. 04Coverage of graph and string algorithms

Use cases

  1. 01Choosing a structure for a problem
  2. 02Checking time and space trade-offs
  3. 03Adapting an algorithm to a language

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/grndlvl/software-patterns --skill clrs-algorithms

After installing, type/clrs-algorithmsin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

complexity-cheat-sheet.md
data-structure-selection.md
data-structures/advanced/
binomial-heap.md
disjoint-set.md
fenwick-tree.md
fibonacci-heap.md
segment-tree.md
skip-list.md
van-emde-boas-tree.md
data-structures/algorithms/
sorting-algorithms.md
data-structures/graphs/
adjacency-list.md
adjacency-matrix.md
graph-algorithms.md
network-flow.md
strongly-connected-components.md
data-structures/hash-based/
bloom-filter.md
hash-set.md
hash-table.md
data-structures/linear/
array.md
deque.md
dynamic-array.md
linked-list.md
queue.md
stack.md
data-structures/strings/
string-algorithms.md
suffix-array.md
suffix-tree.md
data-structures/trees/
avl-tree.md
b-tree.md
binary-tree.md

Details

From the project README

CLRS Data Structures & Algorithms Reference

A comprehensive reference for data structures and algorithms based on "Introduction to Algorithms" (CLRS). This skill provides language-agnostic guidance with pseudocode examples that can be translated to any programming language.

When This Skill Activates

This skill automatically activates when you:

  • Ask about or need to implement a data structure
  • Need to choose between data structures for a problem
  • Discuss time/space complexity trade-offs
  • Need algorithm implementations (sorting, searching, graph algorithms)
  • Mention specific structures: B-tree, heap, hash table, graph, etc.

Quick Data Structure Reference

Linear Structures
StructureAccessSearchInsertDeleteUse When
ArrayO(1)O(n)O(n)O(n)Known size, index access
Dynamic ArrayO(1)O(n)O(1)*O(n)Unknown size, frequent append
Linked ListO(n)O(n)O(1)O(1)Frequent insert/delete
StackO(1)O(n)O(1)O(1)LIFO needed
QueueO(1)O(n)O(1)O(1)FIFO needed
DequeO(1)O(n)O(1)O(1)Both ends access
Trees
StructureSearchInsertDeleteUse When
Binary Search TreeO(log n)*O(log n)*O(log n)*Ordered data, frequent search
AVL TreeO(log n)O(log n)O(log n)Guaranteed balance needed
Red-Black TreeO(log n)O(log n)O(log n)Frequent inserts/deletes
B-TreeO(log n)O(log n)O(log n)Disk-based storage
TrieO(m)O(m)O(m)String/prefix operations
HeapO(1)/O(n)O(log n)O(log n)Priority queue needed
Splay TreeO(log n)*O(log n)*O(log n)*Self-adjusting, temporal locality
TreapO(log n)*O(log n)*O(log n)*Randomized balance, split/merge
Interval TreeO(log n)O(log n)O(log n)Interval overlap queries
Order-Statistic TreeO(log n)O(log n)O(log n)Rank/select queries
K-D TreeO(log n)*O(log n)*O(log n)*Multi-dimensional spatial data
Hash-Based
StructureSearchInsertDeleteUse When
Hash TableO(1)*O(1)*O(1)*Fast key-value lookup
Hash SetO(1)*O(1)*O(1)*Unique membership testing
Bloom FilterO(k)O(k)N/AProbabilistic membership
Graphs
StructureSpaceAdd EdgeQuery EdgeUse When
Adjacency ListO(V+E)O(1)O(degree)Sparse graphs
Adjacency MatrixO(V²)O(1)O(1)Dense graphs
Graph Algorithms
AlgorithmTimeUse When
Network FlowO(VE²)Max flow, bipartite matching, min cut
Strongly Connected ComponentsO(V+E)Find SCCs, 2-SAT, dependency analysis
Strings
StructureBuildSearchUse When
Suffix ArrayO(n log n)O(m log n)Space-efficient string matching
Suffix TreeO(n)O(m)Fast pattern matching, LCS
String AlgorithmsO(m)O(n)KMP, Rabin-Karp, Boyer-Moore, Aho-Corasick
Advanced
StructureUse When
Skip ListProbabilistic balanced list
Disjoint SetUnion-find operations
Segment TreeRange queries with updates
Fenwick TreePrefix sums with updates
Fibonacci HeapDijkstra, Prim with O(1) decrease-key
Binomial HeapMergeable priority queue
van Emde Boas TreeInteger keys with O(log log u) operations
Algorithms
AlgorithmUse When
Sorting AlgorithmsQuickSort, MergeSort, HeapSort, RadixSort, and more

* = amortized or average case

Decision Guides

How to Use This Reference

  1. Choosing a structure: Start with the decision guides
  2. Learning a structure: Read the full documentation with examples
  3. Quick reminder: Use the tables above for at-a-glance reference
  4. Implementation: Follow the pseudocode, adapt to your language

Language Translation Notes

The pseudocode in this reference uses these conventions:

  • class for type definitions
  • function for methods/functions
  • -> for method calls on objects
  • // for comments
  • Type hints shown as name: Type

Translate to your language:

  • PHP: class, function, ->, //, type hints in docblocks or PHP 8+
  • JavaScript/TypeScript: class, function/arrow, ., //, TS types
  • Python: class, def, ., #, type hints
  • Java/C#: Direct mapping with new, generics

Based on concepts from "Introduction to Algorithms" by Cormen, Leiserson, Rivest, and Stein (CLRS), MIT Press.

Comments

Markdown supported