Algorithms and data structures in php

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

A repository with implementations of different data structures and algorithms using PHP

License

mirahman/PHP-Data-Structure-and-Algorithms

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Sign In Required

Please sign in to use Codespaces.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

README.md

PHP Data Structures and Algorithms

Data structure and Algorithm is always important for any programming language. PHP, being one of the most popular language for web development, also requires the pure data structure and algorithm implementations.

In this project, i am trying to cover major data structure and algorithm implementations using PHP 7. For more details discussion about the topics, you can read my book , https://www.amazon.com/PHP-7-Data-Structures-Algorithms/dp/178646389X/

Any feedback, bugs or suggestion will be welcomed.

  1. Linked List
    • Single Linked list
    • Circular Linked list
    • Doubly Linked List
  2. Stacks
    • Stack using Array
    • Stack using Linked List
  3. Queues
    • Queue using Array
    • Queue using Linked List
    • Priority Queue
    • Circular Queue
    • Double Ended Queue — DeQueue
  4. Trees
    • Generic Tree
    • Binary Tree
    • Binary Search Tree
    • Tree Traversal (In-order, pre-order, post-order)
    • Trie (Simple insert and search operation)
  5. Heaps
    • Min Heap
    • Max Heap
  6. Graph
    • BFS
    • Bellman Ford Algorithm
    • DFS
    • Dijkstra
    • Floyd Warshall
    • Kruksal
    • Prim Minimum Spanning tree
    • Topological Sorting
  7. Sorting
    • Bubble sort
    • Bubble Sort with improvements
    • Bucket sort
    • Heap Sort
    • Insertion Sort
    • Merge Sort
    • Quick Sort
    • Radix Sort
    • Selection Sort
  8. Searching
    • BFS
    • Binary Search (Iterative)
    • Binary Search (Recursive)
    • DFS
    • DFS using Stack
    • Exponential Search
    • Interpolation Search
    • Repetitive Binary Search
  9. Dynamic Programming and Others
    • Sudoku (Backtracking)
    • Collaborative Filtering
    • DNA Sequencing (NeedlemanWunsch Algorithm)
    • 0/1 KnapSack Dynamic Programming
    • Fibonacci (Recursive)
    • Fibonacci (Memoized)
    • Huffman Encoding (Greedy Algorithm)
    • Job Scheduler (Greedy Algorithm)
    • KMP String matching algorithm
    • Longest Common Subsequences (LCS)
    • Pattern Matching
    • Sparse Array
  10. Numbers and Maths — PHP Big Integer Implementation — Prime number generation — Sieve
Читайте также:  Sax parser java example

I know lots of things are missing in the list? Would you mind to let me know what you wanna see implemented? I will priortize those and add here.

  • AVL tree implemenations
  • Project Euler Solutions in PHP for Hackerrank.com
  • More algorithms

About

A repository with implementations of different data structures and algorithms using PHP

Источник

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

Data Structure and Algorithm explanations with Implementations by PHP

Algorithm-archive/Learn-Data_Structure-Algorithm-by-PHP

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Sign In Required

Please sign in to use Codespaces.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

README.md

Learn Data Structure and Algorithms by PHP

You need to have basic understanding of the PHP programming language to proceed with the codes from this repository.

  • Introduction to PHP
  • Data Structure
    • Linked List
    • Stack
    • Queue
    • Binary Search Tree (BST)
    • Heap
    • Hash Table
    • Disjoint Set Union (Union Find)
    • Trie
    • Suffix Array
    • Segment Tree
    • Binary Indexed Tree (BIT)
    • Heavy Light Decomposition
    • Linear Search
    • Binary Search
    • Ternary Search
    • Selection Sort
    • Bubble Sort
    • Insertion Sort
    • Merge Sort
    • Quick Sort
    • Bucket Sort
    • Counting Sort
    • Heap Sort
    • Radix Sort
    • Graph Representation
    • Breadth First Search (BFS)
    • Depth First Search (DFS)
    • Topological Sort
    • Strongly Connected Components (SCC)
    • Minimum Spanning Tree (MST)
    • All Pairs Shortest Path (Floyd Warshall’s Algorithm)
    • Single Source Shortest Path Algorithm
      • Djkastra’s Algorithm
      • Bellman Ford Algorithm
      • Maximum Flow
      • Minimum Cut
      • Min-Cost Max Flow
      • Maximum Bipartite Matching
      • Vertex Cover
      • Rod Cutting
      • Maximum Sum (1D, 2D)
      • Coin Change
      • Longest Common Subsequence
      • Longest Increasing Subsequence
      • Matrix Multiplication
      • Edit Distance (Levenshtein distance)
      • 0/1 Knapsack
      • Travelling Salesman Problem
      • Optimal Binary Search Tree
      • Activity Selection/Task Scheduling
      • Huffman Coding
      • Knapsack Problem (Fractional Knapsack)
      • Rabin-Karp Algorithm
      • Knuth-Morris-Pratt Algorithm
      • Z Algorithm
      • Aho-Korasick Algorithm
      • Manachers Algorithm
      • Boyr-Moore Algorithm
      • Greatest Common Divisor (GCD)
      • Longest Common Multiplier (LCM)
      • Euler Totient (Phi)
      • Prime finding(Sieve of Eratosthenes)
      • Prime factorization
      • Factorial
      • Fibonacci
      • Counting, Permutation, combination
      • Exponentiation
      • Big Mod
      • Euclid, Extended euclid
      • Josephus Problem
      • Farey Sequence
      • Catalan numbers
      • Burnside’s lemma/circular permutation
      • Modular inverse
      • Probability
      • Chinese Remainder Theorem
      • Gaussian Elmination method
      • Dilworth’s Theorem
      • Matrix Exponentiation
      • Pick’s Theorem
      • Convex hull
      • Line Intersection
      • Point in a polygon
      • Area of a polygon
      • Line Sweeping
      • Polygon intersection
      • Closest Pair
      • Take Away Game
      • Nim’s Game
      • Sprague-grundy Number
      • BackTracking
        • N-Queen’s Problem

        PHP is a dynamic language with Weak Typing. That means you don’t have to declare the type of a variable ahead of time. The type will get determined automatically while the program is being processed. That also means that variables are not «bound» to a specific data type.:

        $foo pl-s">x"; // foo contains a string $foo = $foo + 2; // foo concatenates with a number echo $foo;

        PHP supports the following data types:

        • Four scalar types:
          • boolean ( True and False )
          • integer (Positive and negative numbers)
          • float (Floating point numbers)
          • string (series of characters)
          • array
          • object
          • callable
          • iterable
          • NULL
          • resource

          More details about data types in PHP:

          Object Oriented Programming in PHP

          Big-O Notation and Time Complexity Analysis

          If you have PHP installed in your machine you can easily run a PHP file using:

          If php command not working in your terminal/command line, then you might need to add it to your environment Path.

          About

          Data Structure and Algorithm explanations with Implementations by PHP

          Источник

          Saved searches

          Use saved searches to filter your results more quickly

          You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

          PHP 7 Data Structures and Algorithm, published by Packt

          License

          PacktPublishing/PHP7-Data-Structures-and-Algorithms

          This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

          Name already in use

          A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

          Sign In Required

          Please sign in to use Codespaces.

          Launching GitHub Desktop

          If nothing happens, download GitHub Desktop and try again.

          Launching GitHub Desktop

          If nothing happens, download GitHub Desktop and try again.

          Launching Xcode

          If nothing happens, download Xcode and try again.

          Launching Visual Studio Code

          Your codespace will open once ready.

          There was a problem preparing your codespace, please try again.

          Latest commit

          Git stats

          Files

          Failed to load latest commit information.

          README.md

          If you have read this book, please leave a review on Amazon.com. Potential readers can then use your unbiased opinion to help them make purchase decisions. Thank you. The $5 campaign runs from December 15th 2020 to January 13th 2021.

          PHP 7 Data Structures and Algorithms

          This is the code repository for PHP 7 Data Structures and Algorithms, published by Packt. It contains all the supporting project files necessary to work through the book from start to finish.

          PHP has always been the go-to language for web based application development, but there are materials and resources you can refer to to see how it works. Data structures and algorithms help you to code and execute them effectively, cutting down on processing time significantly.

          Instructions and Navigation

          All of the code is organized into folders. Each folder starts with a number followed by the application name. For example, Chapter02.

          All chapters contain code files.

          The code will look like the following:

          [default] class TreeNode < public $data = NULL; public $children = []; public function __construct(string $data = NULL) < $this->data = $data; > public function addChildren(TreeNode $node) < $this->children[] = $node; > > 

          All you need to have is the latest PHP version (minimum requirement is PHP 7.x) installed on your machine. You can run the examples from a command line, which does not require a web server. However, if you want, you can install Apache or Nginx, or the following: PHP 7.x+, Nginx/apache (optional), PHP IDE or code editor.

          If you have already purchased a print or Kindle version of this book, you can get a DRM-free PDF version at no cost.
          Simply click on the link to claim your free PDF.

          About

          PHP 7 Data Structures and Algorithm, published by Packt

          Источник

Оцените статью