A linked list in which every element knows about its predecessor and its successor.
______ ______ ______
| | | | | | | | | | | |
| | | <---> | | <---> | | |
|_|__|_| |_|__|_| |_|__|_|
prev n next
ℹ️ This is a pure ESM module.
Run yarn add @ffflorian/doublelinkedlist
or npm i @ffflorian/doublelinkedlist
.
import {LinkedList} from '@ffflorian/doublelinkedlist';
const list = new LinkedList();
list.add('one');
list.add('two');
list.add('three');
list.get(0); // 'one'
The full API documentation is available at https://ffflorian.github.io/DoubleLinkedList.
First, install the needed packages for testing:
yarn
Now run the tests:
yarn test