Skip to content

This repo covers essential algorithms in PHP, including sorting, searching, dynamic programming, and more. It provides both Turkish and English explanations, along with practical PHP implementations, aiming to teach algorithms for real-world business applications.

Notifications You must be signed in to change notification settings

enestoy/PHP-Algorithms-Basics-to-Business

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP Algorithms: Basics to Business

📌 About the Project

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.

🎯 Our Goals

  • 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

📂 Content

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.

📌 Covered Algorithms

1. Sorting Algorithms

  • Bubble Sort
  • Selection Sort
  • Insertion Sort
  • Merge Sort
  • Quick Sort
  • Heap Sort
  • Radix Sort
  • Counting Sort
  • Bucket Sort

2. Searching Algorithms

  • Linear Search
  • Binary Search
  • Jump Search
  • Exponential Search

3. Data Structures Algorithms

  • 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)

4. Graph Algorithms

  • 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)

5. Dynamic Programming Algorithms

  • 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)

6. Divide and Conquer Algorithms

  • Merge Sort
  • Quick Sort
  • Binary Search
  • Strassen's Matrix Multiplication

7. Backtracking Algorithms

  • N-Queens Problem
  • Subset Sum Problem
  • Sudoku Solver
  • Graph Coloring
  • Hamiltonian Path

8. Greedy Algorithms

  • Fractional Knapsack Problem
  • Huffman Coding
  • Activity Selection Problem
  • Job Scheduling Problem
  • Prim’s Algorithm (MST)

9. Advanced Algorithms

  • Floyd’s Cycle-Finding Algorithm (Tortoise and Hare)
  • Topological Sort
  • Sieve of Eratosthenes
  • Union-Find (Disjoint Set)
  • Turing Machines

10. Mathematical Algorithms

  • Greatest Common Divisor (GCD) - Euclidean Algorithm
  • Sieve of Eratosthenes (Prime Number Generation)
  • Fast Exponentiation
  • Fermat’s Little Theorem
  • Modular Arithmetic Algorithms
  • Chinese Remainder Theorem

11. String Matching and Manipulation Algorithms

  • KMP (Knuth-Morris-Pratt) Algorithm
  • Rabin-Karp Algorithm
  • Boyer-Moore Algorithm
  • Z-Algorithm

12. Multi-Variable Optimization

  • Simulated Annealing
  • Genetic Algorithms
  • Ant Colony Optimization

13. Similarity and Clustering Algorithms

  • K-Means Clustering
  • Hierarchical Clustering
  • Nearest Neighbors
  • DBSCAN

14. Other Important Algorithms

  • Bloom Filter
  • Reservoir Sampling
  • Karnaugh Map (Boolean Minimization)
  • Consensus Algorithms (Paxos, Raft, etc.)
  • MapReduce
  • Monte Carlo Methods

🚀 Algorithms in High Demand in Business

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

🚀 How You Can Contribute?

🎯 If you find bugs, want to add new algorithms, or have suggestions for improvements, feel free to send a pull request.

📜 License

This project is licensed under the MIT License.

About

This repo covers essential algorithms in PHP, including sorting, searching, dynamic programming, and more. It provides both Turkish and English explanations, along with practical PHP implementations, aiming to teach algorithms for real-world business applications.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages