# Algorithm Topics
1. Complexity Analysis
- Time Complexity
- Space Complexity
- Big-O, Big-Theta, Big-Omega Notations
- Best, Worst, and Average Case Analysis
- Amortized Analysis
2. Sorting Algorithms
- Bubble Sort
- Selection Sort
- Insertion Sort
- Merge Sort
- Quick Sort
- Heap Sort
- Counting Sort
- Radix Sort
- Bucket Sort
- Shell Sort
- Tim Sort
3. Searching Algorithms
- Linear Search
- Binary Search
- Ternary Search
- Jump Search
- Interpolation Search
- Exponential Search
4. Divide and Conquer Algorithms
- Merge Sort
- Quick Sort
- Binary Search
- Closest Pair of Points
- Strassen’s Matrix Multiplication
- Karatsuba Algorithm (Fast Multiplication)
5. Greedy Algorithms
- Activity Selection
- Huffman Coding
- Kruskal’s Algorithm (MST)
- Prim’s Algorithm (MST)
- Dijkstra’s Shortest Path
- Job Sequencing with Deadlines
- Fractional Knapsack
6. Dynamic Programming (DP)
- Fibonacci Number (Memoization & Tabulation)
- Longest Common Subsequence (LCS)
- Longest Increasing Subsequence (LIS)
- 0/1 Knapsack Problem
- Coin Change Problem
- Matrix Chain Multiplication
- Floyd-Warshall Algorithm (All-Pairs Shortest Path)
- Bellman-Ford Algorithm
- Edit Distance
- Rod Cutting Problem
- Travelling Salesman Problem (TSP)
7. Backtracking
- N-Queens Problem
- Rat in a Maze
- Sudoku Solver
- Word Search
- Hamiltonian Cycle
- Subset Sum Problem
8. Graph Algorithms
- Graph Representations (Adjacency List, Matrix)
- BFS (Breadth-First Search)
- DFS (Depth-First Search)
- Topological Sorting
- Dijkstra’s Algorithm
- Bellman-Ford Algorithm
- Floyd-Warshall Algorithm
- Prim’s Algorithm (MST)
- Kruskal’s Algorithm (MST)
- Strongly Connected Components (Kosaraju’s & Tarjan’s Algorithm)
- Eulerian Path and Circuit
- Hamiltonian Path and Circuit
- A* Search Algorithm
- Bridges and Articulation Points
9. String Algorithms
- Naive Pattern Matching
- Rabin-Karp Algorithm
- Knuth-Morris-Pratt (KMP) Algorithm
- Boyer-Moore Algorithm
- Z Algorithm
- Suffix Array and LCP (Longest Common Prefix)
- Suffix Tree
- Aho-Corasick Algorithm (Multiple Pattern Matching)
10. Bit Manipulation Algorithms
- Bitwise AND, OR, XOR, NOT
- Checking if a Number is Power of 2
- Count Set Bits (Brian Kernighan’s Algorithm)
- Find the Single Non-Repeating Element
- Bit Masking
11. Mathematical Algorithms
- GCD (Greatest Common Divisor) - Euclidean Algorithm
- LCM (Least Common Multiple)
- Sieve of Eratosthenes (Prime Numbers)
- Extended Euclidean Algorithm
- Modular Exponentiation
- Fermat’s Theorem
- Chinese Remainder Theorem
- Fibonacci using Matrix Exponentiation
- Catalan Numbers
- Josephus Problem
12. Number Theory
- Prime Factorization
- Miller-Rabin Primality Test
- Euler’s Totient Function
- Modulo Inverse
- Discrete Logarithm Problem
13. Geometry Algorithms
- Convex Hull (Graham’s Scan, Jarvis’s March)
- Line Intersection
- Closest Pair of Points
- Rotating Calipers
- Sweep Line Algorithm
14. Tree Algorithms
- Tree Traversals (Preorder, Inorder, Postorder, Level Order)
- Lowest Common Ancestor (LCA)
- Binary Search Tree (BST) Operations
- Segment Tree (Range Queries)
- Fenwick Tree (Binary Indexed Tree)
- AVL Tree
- Red-Black Tree
- Trie (Prefix Tree)
15. Hashing Algorithms
- Hash Tables
- Collision Resolution Techniques (Chaining, Open Addressing)
- Rolling Hash
- Bloom Filter
16. Heaps & Priority Queues
- Binary Heap (Min Heap, Max Heap)
- Fibonacci Heap
- D-ary Heap
17. Network Flow Algorithms
- Ford-Fulkerson Algorithm (Maximum Flow)
- Edmonds-Karp Algorithm
- Dinic’s Algorithm
18. Game Theory Algorithms
- Minimax Algorithm
- Alpha-Beta Pruning
- Nim Game
- Sprague-Grundy Theorem
19. Randomized Algorithms
- QuickSort (Randomized Pivot)
- Randomized Primality Testing
- Reservoir Sampling
- Monte Carlo & Las Vegas Algorithms
20. Approximation Algorithms
- Vertex Cover Approximation
- Set Cover Problem
- Traveling Salesman Approximation
21. Parallel & Distributed Algorithms
- MapReduce Algorithm
- Parallel Sorting Algorithms
# AI Instructions
- Create a separate **C++ file** for each algorithm in the list.
- Ensure **detailed comments** explaining the code, step-by-step logic, and time
complexity analysis.
- If an algorithm is too large for one file, **continue writing it in the next
file** (e.g., 'Algorithm1_part1.cpp', 'Algorithm1_part2.cpp').
- Name the files **appropriately** based on the algorithm topic (e.g.,
'BubbleSort.cpp', 'Dijkstra.cpp').