Przejdź do treści
Biblioteka skilli
Programowanie · Analiza

apply-algorithms

/apply-algorithms

Dopasowuje problem do klasycznej rodziny algorytmów (programowanie dynamiczne, zachłanne, dziel i zwyciężaj, przeszukiwanie grafów, sortowanie najpierw) i uzasadnia wybór.

Licencja
MIT
Ostatnia zmiana repozytorium
23.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 23.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Dopasowuje problem do klasycznej rodziny algorytmów (programowanie dynamiczne, zachłanne, dziel i zwyciężaj, przeszukiwanie grafów, sortowanie najpierw) i uzasadnia wybór.

Oryginalny opis (EN)

Use when a problem shape maps to a classic family — dynamic programming, greedy, divide-and-conquer, graph search, or sort-first — and you must pick and justify the algorithm.

Jak działa

  1. The families
  2. 1. Audit (change nothing)
  3. 2. Pick and justify
  4. 3. State the complexity and the edge cases
  5. Verify
  6. When to deviate
Sekcje z nagłówków SKILL.md, w oryginale · 54 linii, 427 słów
Podgląd SKILL.md
---
name: apply-algorithms
description: Use when a problem shape maps to a classic family — dynamic programming, greedy, divide-and-conquer, graph search, or sort-first — and you must pick and justify the algorithm.
---

# Apply Algorithms

Maps a problem's shape to the classic algorithm family that solves it (CLRS), with the complexity that
justifies the choice. Data-structure half of the decision: [choose-data-structure](../choose-data-structure/SKILL.md).

## The families

- **Divide and conquer** — independent subproblems, combine the results (mergesort, binary search).
  Solve the recurrence with the master theorem; often `O(n log n)`.
- **Dynamic programming** — *overlapping* subproblems with optimal substructure: cache the repeated work.
  When a recursive solution recomputes the same subproblem, DP memoises it. `O(n)`–`O(n²)` typical.
- **Greedy** — a locally optimal choice is globally optimal, *only when a greedy-choice proof holds*
  (Huffman coding, Kruskal/Prim MST `O(E log V)`). Never use greedily on a hunch; it is either proven or
  wrong.
- **Graph search** — BFS/DFS `O(V + E)` for reachability, connected components, topological sort;
  Dijkstra `O((V + E) log V)` for non-negative shortest paths only (any negative edge breaks it); Bellman-Ford `O(VE)` for negative edges, and it detects negative cycles;
  Floyd-Warshall `O(V³)` for all pairs.
- **Sort-first** — sort then scan turns many pairwise problems into one pass (`O(n log n)` + `O(n)`).
- **Bounded-integer tricks** — counting/radix/bucket sort reach `O(n)` when keys are small integers.

## 1. Audit (change nothing)

```bash
cat .claude/stack-profile.md 2>/dev/null | head -20
grep -rn "sort\|recur\|memo\|visited\|queue\|stack\|priority" --include="*.ts" --include="*.rs" --include="*.go" --include="*.py" . 2>/dev/null | head -30
```

State the problem in one line, then name its shape: optimal substructure and overlapping subproblems →
DP; independent subproblems → divide and conquer; a provable local optimum → greedy; nodes and edges or
reachability → graph; "for each pair" → sort-first.

## 2. Pick and justify

- DP: identify the state, the recurrence, and the base case; memoise or bottom-up.
- Greedy: write the exchange/proof argument first; without it, fall back to DP.
- Graph: choose the traversal by the question (reachability, shortest path, cycles, ordering).
- Sort-first: sort by the key that makes the remaining question one linear pass.

## 3. State the complexity and the edge cases

Give the time and space order of the chosen algorithm, and the inputs it fails on: negatives (Dijkstra),
already-sorted (quicksort), a cycle (topological sort), a graph with no path (shortest path).

## Verify

The chosen family matches the named problem shape, the complexity is stated, and the edge case that
breaks the algorithm is handled. A counterexample to a greedy choice fails the proof before it ships.

## When to deviate

- The problem is small: the simplest correct algorithm beats the clever one.
- A well-tested standard-library or framework function already implements it — call it, do not re-implement.

Wersje

W bazie nie ma innych skilli o nazwie apply-algorithms.

Migawka bazy z 13.11.2026 · wersja paczki 52df4f9edbe3 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100computer-science-algorithms
    Pomaga wybierać i implementować algorytmy i struktury danych: złożoność asymptotyczną, sortowanie, programowanie dynamiczne, grafy, algorytmy zachłanne oraz narzędzia na dużą skalę jak Bloom filter, HyperLogLog i consistent hashing.
  • 90role-algorithms:algorithm-design
    Projektuje algorytmy z analizą złożoności, dowodami poprawności i doborem paradygmatu, np. zachłannego lub programowania dynamicznego.
  • 95algorithms-education
    Podpowiada konwencje dla repozytorium z algorytmami w Javie: struktury danych, grafy, programowanie dynamiczne i zadania w stylu LeetCode.
  • 80role-algorithms:dynamic-programming
    Rozwiązuje problemy optymalizacyjne programowaniem dynamicznym: memoizacją, tabelaryzacją i projektowaniem przestrzeni stanów.
  • 100graph-algorithms-interviewer
    Prowadzi trening rozmowy kwalifikacyjnej z algorytmów grafowych, takich jak BFS, DFS, najkrótsze ścieżki i sortowanie topologiczne, z podpowiedziami i oceną odpowiedzi.
  • 95dynamic-programming
    Projektuje i implementuje programowanie dynamiczne dla optymalizacji kombinatorycznej: przestrzeń stanów, rekurencje Bellmana, memoizacja i tabelaryzacja, odzyskiwanie rozwiązania i algorytmy etykietowania.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.