double-linked-list
A linked list in which every element knows about its predecessor and its successor.
______ ______ ______
| | | | | | | | | | | |
| | | <---> | | <---> | | |
|_|__|_| |_|__|_| |_|__|_|
prev n next
Prerequisites
Installation
ℹ️ This is a hybrid CommonJS / ESM module.
Run yarn add @ffflorian/doublelinkedlist
or npm i @ffflorian/doublelinkedlist
.
Usage
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.
Testing
First, install the needed packages for testing:
yarn
Now run the tests:
yarn test