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

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.

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)