https://github.com/anglesoft/linked
🖇 Linked List implementation in PHP.
https://github.com/anglesoft/linked
data-structures-algorithms php
Last synced: 15 days ago
JSON representation
🖇 Linked List implementation in PHP.
- Host: GitHub
- URL: https://github.com/anglesoft/linked
- Owner: anglesoft
- License: mit
- Created: 2019-03-10T16:35:58.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-03-10T16:54:40.000Z (almost 7 years ago)
- Last Synced: 2024-04-24T00:29:44.842Z (almost 2 years ago)
- Topics: data-structures-algorithms, php
- Language: PHP
- Homepage:
- Size: 9.77 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 🖇 Linked
Linked List implementation in PHP.
## Installation
```shell
composer require angle/linked
```
## Usage
Creating an empty list and appending items.
```php
$list = new Angle\Linked\Linked;
$list->append('PHP');
$list->append('Ruby');
$list->append('Javascript');
print $list->head->next->next->data; // Javascript
```
Prepend elements to the list:
```php
$list->prepend('Golang');
print $list->head->data; // Golang
```
Print the list:
```php
print $list; // Golang, PHP, Ruby, Javascript
```
## Contributing
Improvements are welcome! Feel free to submit pull requests.
## Licence
MIT
Copyright © 2019 [Angle Software](https://angle.software)