This repository is designed for those who want to learn the basic principles of algorithms and see how they can be implemented using PHP. We aim to explain algorithm logic both theoretically and practically, adhering to clean code principles and making it easy to understand.
- Explain algorithms in a simple and understandable way
- Develop applications in PHP following clean code principles
- Teach important algorithms used in the business world
- Reach a wide audience with both Turkish and English resources
Each algorithm in this repo is covered with four files:
✅ Turkish Markdown (.md): Explains the core concepts of the algorithm.
✅ English Markdown (.md): Provides explanation for a global audience in English.
✅ Turkish PHP File (.php): PHP implementation of the algorithm.
✅ English PHP File (.php): PHP code example according to the English documentation.
- Bubble Sort
- Selection Sort
- Insertion Sort
- Merge Sort
- Quick Sort
- Heap Sort
- Radix Sort
- Counting Sort
- Bucket Sort
- Linear Search
- Binary Search
- Jump Search
- Exponential Search
- Linked List: Singly, Doubly, Circular
- Stack
- Queue
- Deque
- Hashing and Hash Tables
- Binary Search Tree (BST)
- AVL Tree (Self-balancing Binary Search Tree)
- Red-Black Tree
- Trie
- Heap (Min-Heap, Max-Heap)
- Graph Data Structures (Adjacency List, Matrix)
- Depth-First Search (DFS)
- Breadth-First Search (BFS)
- Dijkstra's Algorithm (Shortest Path)
- Bellman-Ford Algorithm
- Floyd-Warshall Algorithm (All-Pairs Shortest Path)
- Kruskal's Algorithm (MST - Minimum Spanning Tree)
- Prim's Algorithm (MST)
- Topological Sorting
- Ford-Fulkerson Algorithm (Max Flow)
- Fibonacci Sequence
- Knapsack Problem
- Longest Common Subsequence (LCS)
- Longest Increasing Subsequence (LIS)
- Coin Change Problem
- Matrix Chain Multiplication
- Rod Cutting Problem
- Edit Distance (Levenshtein Distance)
- Merge Sort
- Quick Sort
- Binary Search
- Strassen's Matrix Multiplication
- N-Queens Problem
- Subset Sum Problem
- Sudoku Solver
- Graph Coloring
- Hamiltonian Path
- Fractional Knapsack Problem
- Huffman Coding
- Activity Selection Problem
- Job Scheduling Problem
- Prim’s Algorithm (MST)
- Floyd’s Cycle-Finding Algorithm (Tortoise and Hare)
- Topological Sort
- Sieve of Eratosthenes
- Union-Find (Disjoint Set)
- Turing Machines
- Greatest Common Divisor (GCD) - Euclidean Algorithm
- Sieve of Eratosthenes (Prime Number Generation)
- Fast Exponentiation
- Fermat’s Little Theorem
- Modular Arithmetic Algorithms
- Chinese Remainder Theorem
- KMP (Knuth-Morris-Pratt) Algorithm
- Rabin-Karp Algorithm
- Boyer-Moore Algorithm
- Z-Algorithm
- Simulated Annealing
- Genetic Algorithms
- Ant Colony Optimization
- K-Means Clustering
- Hierarchical Clustering
- Nearest Neighbors
- DBSCAN
- Bloom Filter
- Reservoir Sampling
- Karnaugh Map (Boolean Minimization)
- Consensus Algorithms (Paxos, Raft, etc.)
- MapReduce
- Monte Carlo Methods
The algorithms most in demand in the business world are:
- Sorting Algorithms: Merge Sort, Quick Sort, Heap Sort
- Searching Algorithms: Linear Search, Binary Search
- Graph Algorithms: DFS, BFS, Dijkstra’s Algorithm
- Dynamic Programming: Knapsack Problem, LCS, LIS, Coin Change Problem
- Greedy Algorithms: Huffman Coding, Activity Selection Problem
- Backtracking: N-Queens, Sudoku Solver
- String Algorithms: Rabin-Karp, KMP, Boyer-Moore
- Other: Union-Find, Sieve of Eratosthenes, Binary Tree Traversals
🎯 If you find bugs, want to add new algorithms, or have suggestions for improvements, feel free to send a pull request.
This project is licensed under the MIT License.