Thanks for contributing to the Algorithm Knowledge Base.
- Claim your topic first (GitHub Issue or claim table in
README.md). - Create your note file in the correct folder (see folder structure in
README.md). - Follow the required section order from the template in
README.md. - Add at least one reusable template with
Use when:,Input:, andOutput:before each code block. - Add concept-check questions with answers inside a
<details>block. - Add LeetCode/Codeforces practice links (no answers needed for those).
- Open a pull request with the title format:
Add note: <Algorithm Name> by @your-username.
- Prefer clear, practical wording over formal textbook style.
- Include small ASCII diagrams when they improve understanding.
- Keep content beginner-friendly but not oversimplified.
- Write in your own words — no copy-paste from Wikipedia or textbooks.
Every code block must be preceded by three lines:
Use when: <when this exact template applies>
Input: <what the function takes>
Output: <what it returns>
This makes templates easy to scan and reuse quickly. See any existing file (e.g., heap/heap.md) for examples.
## One-sentence definition## When to use it (use cases)## Step-by-step explanation (plain language, no code first)## Templates (<language>)## Time & space complexity (Big O)## Practice questions (concept check)— with a<details>answers block## Practice questions (LeetCode/Codeforces)## One thing that was confusing to me## See also
- Use lowercase and hyphens for filenames:
merge-sort.md,binary-search.md. - Place your file in the matching topic folder. Current folders:
array/ ← two pointers and array techniques
backtracking/
Bitwise/
dynamic-programming/
graph/ ← BFS, DFS, Dijkstra, Kruskal, Topological Sort
heap/
linked-list/
prefix-sum/
recursion/
searching/ ← Binary Search, Jump Search, Exponential Search
sliding-window/
sorting/ ← Merge Sort, Quick Sort
trie/
union-find/
heap/heap.mdrecursion/recursion.mdlinked-list/singly-linked-list.mdsorting/merge-sort.mdbacktracking/backtracking.md