Highly optimized and performant search algorithms for binary search trees (BST), graphs, and arrays. Each algorithm is implemented in both C++ and Python and is accompanied with clear explanations of the underlying logic and performance-optimizing techniques, along with their applications.
- Linear Search
- Binary Search
- Binary Search w/ Recursion
- Binary Search w/ Duplicates
- Ternary Search
- Jump Search (for sorted arrays)
- Exponential Search (for unbounded arrays)
- Interpolation Search (for uniformly distributed sorted arrays)
- Fibonacci Search
- Binary Search
- Inserting a Node
- Deleting a Node
- Find Minimum Node
- Find Maximum Node
- Depth-First Search (DFS):
- Pre-Order Traversal
- In-Order Traversal
- Post-Order Traversal
- Breadth-First Search (BFS)
- Find Successor/Predecessor
- Balancing BST (e.g., AVL Tree, Red-Black Tree)
- Searching for a Specific Vertex
- Depth-First Search (DFS)
- Pre-Order Traversal
- In-Order Traversal
- Post-Order Traversal
- Breadth-First Search (BFS)
- Cycle Detection (for Cyclic Graphs)
- Connected Components (using DFS/BFS)
- DFS for Directed Graphs
- Topological Sort (for Directed Acyclic Graphs)
- Strongly Connected Components (Kosaraju’s/Tarjan's algorithms)
- Dijkstra's Algorithm (shortest path)
- Bellman-Ford Algorithm (handles negative weights)
- Floyd-Warshall Algorithm (for all-pairs shortest path)
- A* Search Algorithm (heuristic-based)
- BFS/DFS (for shortest path and traversal)
- Minimum Spanning Tree:
- Prim's Algorithm
- Kruskal's Algorithm
- Bipartite Graph Check (using BFS/DFS)
- Eulerian Path/Circuit
- Hamiltonian Path
- Trie Search (prefix-based searching)
If you have suggestions to optimize an algorithm, identify any issues, or improve the documentation, please fork the repository and submit a pull request. Alternatively, you can also open an issue to start a discussion about the potential improvement.