An open API service indexing awesome lists of open source software.

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

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