Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

computer-science-algorithms

БесплатноБез исполняемых скриптовНе проверен

Choosing or implementing an algorithm or data structure — asymptotic complexity, data-structure selection, sorting & searching, dynamic programming, graph…

pproencaот pproenca★ 231 звезда на GitHub

Об этом скилле

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, and the 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
  • Modeling a problem as a graph (BFS vs Dijkstra vs topological sort)
  • Refactoring brute force / naive solutions that work on toy inputs but time out at scale
  • Deciding whether greedy applies, or whether DP / branch-and-bound is required

Rule Categories By Priority

# Category Prefix Impact Why it cascades
1 Asymptotic Complexity & Algorithm Selection comp- CRITICAL Wrong O() class makes every other optimization irrelevant
2 Data Structure Selection ds- CRITICAL The container determines which operations are cheap
3 Sorting & Searching srch- HIGH Foundation for greedy, two-pointer, sweep-line, binary-search-on-the-answer
4 Dynamic Programming dp- HIGH Exponential → polynomial transformations
5 Graph Algorithms graph- HIGH Networks, dependencies, routing, scheduling all reduce to graphs
6 Divide & Conquer / Recursion divide- MEDIUM-HIGH Logarithmic-factor speedups; stack-depth and recurrence traps
7 Greedy Algorithms greedy- MEDIUM Fast when correct, silently wrong when not
8 String & Sequence Algorithms str- MEDIUM Pattern matching, parsing, substring queries
9 Scale & Probabilistic Algorithms scale- MEDIUM Sketches, streaming, distributed primitives — situational, decisive when they apply

Quick Reference

1. Asymptotic Complexity & Algorithm Selection (CRITICAL)

2. Data Structure Selection (CRITICAL)

Полный SKILL.md на GitHub

Установить computer-science-algorithms в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

AGENTS.mdassets/templates/_template.mdmetadata.jsonreferences/_sections.mdreferences/comp-amortize-instead-of-worst-casing.mdreferences/comp-derive-recurrences-via-master-theorem.mdreferences/comp-pick-algorithm-class-from-input-bound.mdreferences/comp-prefer-iterative-builders-over-string-concatenation.mdreferences/comp-treat-space-complexity-as-first-class.mdreferences/comp-watch-for-quadratic-blowup-from-membership-in-list.mdreferences/divide-meet-in-the-middle-for-subset-problems.mdreferences/divide-merge-sort-pattern-for-counting-inversions.mdreferences/divide-quickselect-vs-quicksort-partitioning.mdreferences/divide-watch-recursion-depth-and-stack.mdreferences/dp-bitmask-for-small-set-states.mdreferences/dp-define-state-precisely.mdreferences/dp-knapsack-pattern.mdreferences/dp-memoize-overlapping-subproblems.mdreferences/dp-prove-optimal-substructure-before-coding.mdreferences/dp-tabulate-when-recursion-depth-or-order-matters.mdreferences/ds-balanced-bst-or-sorted-container-for-range-queries.mdreferences/ds-deque-for-both-end-operations.mdreferences/ds-fenwick-or-segment-tree-for-mutable-range-queries.mdreferences/ds-hash-map-for-keyed-lookup.mdreferences/ds-heap-for-top-k-and-priority-queues.mdreferences/ds-prefix-sums-for-repeated-range-sums.mdreferences/ds-set-for-uniqueness-and-membership.mdreferences/ds-union-find-for-dynamic-connectivity.mdreferences/graph-bfs-for-unweighted-shortest-path.mdreferences/graph-detect-cycles-during-dfs.mdreferences/graph-dijkstra-for-non-negative-weights.mdreferences/graph-kruskal-or-prim-for-mst.mdreferences/graph-represent-as-adjacency-list-not-matrix.mdreferences/graph-topological-sort-for-dependency-order.mdreferences/greedy-huffman-and-priority-queue-greedies.mdreferences/greedy-interval-merge-and-sweep-line.mdreferences/greedy-prove-exchange-argument-before-using.mdreferences/greedy-sort-by-the-right-key-for-scheduling.mdreferences/scale-aho-corasick-for-multi-pattern-search.mdreferences/scale-bloom-filter-for-probabilistic-membership.md

FAQ

Что делает скилл 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."

Как установить скилл computer-science-algorithms?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл computer-science-algorithms запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить computer-science-algorithms с