https://github.com/samyouaret/php-datastructure
A small PHP data-structure package
https://github.com/samyouaret/php-datastructure
algorithms data-structures linked-list php queue stack
Last synced: 12 months ago
JSON representation
A small PHP data-structure package
- Host: GitHub
- URL: https://github.com/samyouaret/php-datastructure
- Owner: samyouaret
- Created: 2019-11-01T17:31:59.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-11-07T02:12:37.000Z (over 6 years ago)
- Last Synced: 2025-02-12T05:45:13.565Z (about 1 year ago)
- Topics: algorithms, data-structures, linked-list, php, queue, stack
- Language: PHP
- Homepage:
- Size: 26.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
PHP data structure package
==========================
This package was not intended to replace the data structure provided by standard PHP library
(**SPL**) , this is package created just for demonstration and teaching purposes and contains the implementation details to basic operations performed by legacy data structure like linked lists providing classes like DoublyLinkedList, Stack and Queue to achieve desired tasks.
Requirements
------------
PHP needs to be a minimum version of PHP 7.1.0.
Installation
------------
at the moment the package is not published at packagist yet, you can clone the package :
... code-bock:: bash
$ git clone https://github.com/samyouaret/php-datastructure.git
Usage
------------
``DoublyLinkedList`` provides rich api the perform mostly tasks needed by linked list
and stacks and queues.
create instance of ``DoublyLinkedList`` and push to it :
```php
list = new DoublyLinkedList();
$this->list->push(5);
```
``DoublyLinkedList`` implements ``AbstractList`` so you can use all methods listed below :
```php