Algorithms
This page links to existing algorithm implementations and explanations in this repository, grouped by topic. Labels: [B] = basic/foundational, [A] = advanced.
Math
- [B] Bit Manipulation
- [B] Binary Floating Point
- [B] Factorial
- [B] Fibonacci Number
- [B] Prime Factors
- [B] Primality Test (trial division)
- [B] Euclidean Algorithm (GCD)
- [B] Least Common Multiple (LCM)
- [B] Sieve of Eratosthenes
- [B] Is Power of Two
- [B] Pascal's Triangle
- [B] Complex Number
- [B] Radian & Degree
- [B] Fast Powering
- [B] Horner's Method
- [B] Matrices (Matrix operations)
- [B] Euclidean Distance
- [A] Integer Partition
- [A] Square Root (Newton's method)
- [A] Liu Hui π Algorithm
- [A] Discrete Fourier Transform
Sets
- [B] Cartesian Product
- [B] Fisher–Yates Shuffle
- [A] Power Set
- [A] Permutations
- [A] Combinations
- [A] Longest Common Subsequence (LCS)
- [A] Longest Increasing Subsequence
- [A] Shortest Common Supersequence (SCS)
- [A] Knapsack Problem (0/1 and Unbound)
- [A] Maximum Subarray
- [A] Combination Sum
Strings
- [B] Hamming Distance
- [B] Palindrome
- [A] Levenshtein Distance
- [A] Knuth–Morris–Pratt (KMP)
- [A] Z Algorithm
- [A] Rabin–Karp
- [A] Longest Common Substring
- [A] Regular Expression Matching
Searches
- [B] Linear Search
- [B] Jump Search
- [B] Binary Search
- [B] Interpolation Search
Sorting
- [B] Bubble Sort
- [B] Selection Sort
- [B] Insertion Sort
- [B] Heap Sort
- [B] Merge Sort
- [B] Quicksort
- [B] Shellsort
- [B] Counting Sort
- [B] Radix Sort
- [B] Bucket Sort
Linked Lists
- [B] Straight Traversal
- [B] Reverse Traversal
Trees
Graphs
- [B] Depth-First Search (DFS)
- [B] Breadth-First Search (BFS)
- [B] Kruskal’s Algorithm (MST)
- [A] Dijkstra’s Algorithm
- [A] Bellman–Ford Algorithm
- [A] Floyd–Warshall Algorithm
- [A] Detect Cycle
- [A] Prim’s Algorithm (MST)
- [A] Topological Sorting
- [A] Articulation Points (Tarjan)
- [A] Bridges
- [A] Eulerian Path
- [A] Hamiltonian Cycle
- [A] Strongly Connected Components
- [A] Travelling Salesman Problem
Cryptography
- [B] Polynomial Hash
- [B] Rail Fence Cipher
- [B] Caesar Cipher
- [B] Hill Cipher
Machine Learning
- [B] k-NN (k-nearest neighbors)
- [B] k-Means
Image Processing
- [B] Seam Carving
Statistics
- [B] Weighted Random
Uncategorized
- [B] Tower of Hanoi
- [B] Square Matrix Rotation
- [B] Jump Game
- [B] Unique Paths
- [B] Rain Terraces
- [B] Recursive Staircase
- [B] Best Time To Buy/Sell Stocks
- [B] Valid Parentheses
- [A] N-Queens Problem
- [A] Knight's Tour
Algorithms by Paradigm
An algorithmic paradigm is a high-level approach used to design algorithms.
Brute Force
- Linear Search
- Rain Terraces
- Recursive Staircase
- Maximum Subarray
- Travelling Salesman Problem
- Discrete Fourier Transform
Greedy
- Jump Game (greedy variant)
- Unbound Knapsack Problem
- Dijkstra’s Algorithm
- Prim’s Algorithm
- Kruskal’s Algorithm
Divide and Conquer
- Binary Search
- Tower of Hanoi
- Pascal's Triangle
- Euclidean Algorithm
- Merge Sort
- Quicksort
- Tree DFS
- Graph DFS
- Matrix traversals
- Jump Game (other approaches)
- Fast Powering
- Best Time To Buy/Sell Stocks
- Permutations
- Combinations
- Maximum Subarray
Dynamic Programming
- Fibonacci Number
- Jump Game
- Unique Paths
- Rain Terraces
- Recursive Staircase
- Seam Carving
- Levenshtein Distance
- Longest Common Subsequence (LCS)
- Longest Common Substring
- Longest Increasing Subsequence
- Shortest Common Supersequence
- 0/1 Knapsack Problem
- Integer Partition
- Maximum Subarray (Kadane)
- Bellman–Ford Algorithm
- Floyd–Warshall Algorithm
- Regular Expression Matching
Backtracking
Branch & Bound
Examples typically include optimization problems like TSP and Knapsack. When available, they will appear here.
Note: Only algorithms that currently exist in this repository are linked above. If you want additional links or sections, let me know and I’ll add them.