Individual skill
computer-science-algorithms
Choosing or implementing an algorithm or data structure — asymptotic complexity, data-structure selection, sorting & searching, dynamic programming, graph algorithms, divide & conquer, greedy algorithms, string/sequence algorithms, and the at-scale toolbox (Bloom filters, HyperLogLog, Count-Min Sketch, reservoir sampling, consistent hashing, external merge sort, Aho-Corasick, MinHash/LSH). Trigger on tasks involving "what's the right algorithm for…", performance-critical code, code with nested loops over the same input, recursive solutions, shortest-path / scheduling / matching / DP problems, code review for accidental O(n²) blowup, and any "how do I do X at scale / on a stream / without enough RAM" question — even if the user doesn't explicitly mention "algorithm" or "complexity."
skills/.experimental/computer-science-algorithms/SKILL.md
Source commit cf93c57cac89d6fc3e4194686000411567f5caf3
What was checked
- Matches the observed repository HEAD
- Yes
- Scanner rules are current
- Yes
- Repository scan complete
- No
- Skill scan complete
- No
- Observed behavior
- Network or broad shell
- Last checked
- Nov 11, 2026
These are observations at the recorded commit, not a guarantee of safety. Review the source before running it.
Install this skill
Choose an agent in your Stack or copy a command below. Commands fetch the pinned commit and copy only this skill directory. Existing destinations are refused. Copying a command does not install anything.
An install command is unavailable: current rules, complete repository and skill scans, an eligible behavior level and a permitted license are required.
Repository context
- Repository stars (not skill ratings)
- 224
- Repository last updated
- Aug 15, 2026
- License
- MIT
Observed agent integration: codex
- engineering Derived category
- data Derived category
Files and excerpt
File metadata and permitted, redacted excerpts come from the recorded scan. Source links are pinned to that commit.
Browse files
AGENTS.mddoc · 13,580 bytesSKILL.mdcore · 13,211 bytesSKILL.mdcore · 13,211 bytesassets/templates/_template.mddoc · 1,243 bytesmetadata.jsonasset · 1,273 bytesreferences/_sections.mddoc · 3,168 bytesreferences/comp-amortize-instead-of-worst-casing.mddoc · 2,508 bytesreferences/comp-derive-recurrences-via-master-theorem.mddoc · 2,069 bytesreferences/comp-pick-algorithm-class-from-input-bound.mddoc · 1,849 bytesreferences/comp-prefer-iterative-builders-over-string-concatenation.mddoc · 1,853 bytesreferences/comp-treat-space-complexity-as-first-class.mddoc · 2,125 bytesreferences/comp-watch-for-quadratic-blowup-from-membership-in-list.mddoc · 1,687 bytesreferences/divide-meet-in-the-middle-for-subset-problems.mddoc · 2,544 bytesreferences/divide-merge-sort-pattern-for-counting-inversions.mddoc · 2,375 bytesreferences/divide-quickselect-vs-quicksort-partitioning.mddoc · 3,035 bytesreferences/divide-watch-recursion-depth-and-stack.mddoc · 2,572 bytesreferences/dp-bitmask-for-small-set-states.mddoc · 2,649 bytesreferences/dp-define-state-precisely.mddoc · 2,856 bytesreferences/dp-knapsack-pattern.mddoc · 2,668 bytesreferences/dp-memoize-overlapping-subproblems.mddoc · 2,445 bytesreferences/dp-prove-optimal-substructure-before-coding.mddoc · 2,684 bytesreferences/dp-tabulate-when-recursion-depth-or-order-matters.mddoc · 2,702 bytesreferences/ds-balanced-bst-or-sorted-container-for-range-queries.mddoc · 2,253 bytesreferences/ds-deque-for-both-end-operations.mddoc · 2,128 bytesreferences/ds-fenwick-or-segment-tree-for-mutable-range-queries.mddoc · 2,191 bytesreferences/ds-hash-map-for-keyed-lookup.mddoc · 2,053 bytesreferences/ds-heap-for-top-k-and-priority-queues.mddoc · 2,080 bytesreferences/ds-prefix-sums-for-repeated-range-sums.mddoc · 2,153 bytesreferences/ds-set-for-uniqueness-and-membership.mddoc · 1,949 bytesreferences/ds-union-find-for-dynamic-connectivity.mddoc · 2,782 bytesreferences/graph-bfs-for-unweighted-shortest-path.mddoc · 2,935 bytesreferences/graph-detect-cycles-during-dfs.mddoc · 2,781 bytesreferences/graph-dijkstra-for-non-negative-weights.mddoc · 2,904 bytesreferences/graph-kruskal-or-prim-for-mst.mddoc · 3,091 bytesreferences/graph-represent-as-adjacency-list-not-matrix.mddoc · 2,759 bytesreferences/graph-topological-sort-for-dependency-order.mddoc · 3,081 bytesreferences/greedy-huffman-and-priority-queue-greedies.mddoc · 2,685 bytesreferences/greedy-interval-merge-and-sweep-line.mddoc · 2,949 bytesreferences/greedy-prove-exchange-argument-before-using.mddoc · 3,029 bytesreferences/greedy-sort-by-the-right-key-for-scheduling.mddoc · 2,881 bytesreferences/scale-aho-corasick-for-multi-pattern-search.mddoc · 5,081 bytesreferences/scale-bloom-filter-for-probabilistic-membership.mddoc · 3,347 bytesreferences/scale-consistent-hashing-for-distributed-sharding.mddoc · 4,355 bytesreferences/scale-count-min-sketch-for-frequency-estimation.mddoc · 4,238 bytesreferences/scale-external-merge-sort-for-out-of-memory-data.mddoc · 4,165 bytesreferences/scale-hyperloglog-for-cardinality-estimation.mddoc · 3,919 bytesreferences/scale-minhash-lsh-for-near-duplicate-detection.mddoc · 6,228 bytesreferences/scale-reservoir-sampling-for-streams.mddoc · 3,972 bytesreferences/srch-binary-search-on-sorted-data.mddoc · 2,681 bytesreferences/srch-counting-and-radix-sort-for-bounded-integer-keys.mddoc · 2,285 bytesreferences/srch-quickselect-for-k-th-element.mddoc · 2,344 bytesreferences/srch-two-pointers-on-sorted-data.mddoc · 2,407 bytesreferences/srch-use-builtin-sort-not-hand-rolled.mddoc · 2,303 bytesreferences/str-kmp-or-builtin-find-not-naive-search.mddoc · 2,649 bytesreferences/str-rolling-hash-for-multiple-substring-comparisons.mddoc · 2,843 bytesreferences/str-suffix-array-or-automaton-for-substring-queries.mddoc · 3,205 bytesreferences/str-trie-for-prefix-queries.mddoc · 3,178 bytes
Read excerpt
# Community Classical Computer Science Algorithms Best Practices
A practitioner-oriented reference for choosing and implementing classical algorithms and data structures correctly. Organized by execution-lifecycle impact: the earliest decisions (asymptotic class, data-structure choice) cascade through everything else, so the rules near the top of the table matter most.
**Scope:** the patterns that show up in everyday production code review, reasonable interview / contest problems, **and the at-scale toolbox** (sketches, streaming, distributed primitives) — not an exhaustive cover of CLRS. Topics intentionally outside the current version: network flow, modular arithmetic, Bellman-Ford and Floyd-Warshall as standalone rules, SCC (Tarjan/Kosaraju), computational geometry, FFT, Manacher / Z-function as standalone rules. They're flagged inline in the relevant rules.
Distilled from CLRS (*Introduction to Algorithms*, 4th ed.), Sedgewick & Wayne (*Algorithms*, 4th ed., Princeton), Skiena's *Algorithm Design Manual*, Laaksonen's *Competitive Programmer's Handbook*, [cp-algorithms.com](https://cp-algorithms.com/), and the [USACO Guide](https://usaco.guide).
## When to Apply
Use these rules when:
- Choosing an algorithm or data structure for a new problem ("what's the right way to do X?")
- Reviewing code for hidden O(n²) blowup — repeated `in`-checks on lists, `pop(0)` on lists, string concatenation in loops, naive substring search
- Picking a DP state or recurrence, before writing the memoization