Skip to content

Latest commit

 

History

History
17 lines (13 loc) · 544 Bytes

README.md

File metadata and controls

17 lines (13 loc) · 544 Bytes

php-linked-list

A linked list implementation in PHP. This linked list will maintain an ordered list of nodes from smallest to greatest. Inserting a new node will place it in the correct position, so the list should never need to be reordered.

It is considered a "stable order" as new nodes that are added, are placed after nodes with the same value.

Additionally, the linked list can also be reversed using $list->reverse();.

To run

php index.php

Output

1, 1, 2, 2, 2, 3, 5, 7, 8, 9
9, 8, 7, 5, 3, 2, 2, 2, 1, 1