@onesy/linked-list
v1.0.0
Published
Linked list
Downloads
60
Maintainers
Readme
Getting started
Add
yarn add @onesy/linked-list
Use cases
- Implementation of stacks
- Efficient removal of elements
- Reduced memory fragmentation
- etc.
Use
import OnesyLinkedList from '@onesy/linked-list';
// Make a new linked list instance
const onesyLinkedList = new OnesyLinkedList();
// Add values
onesyLinkedList.add(1).add(4);
onesyLinkedList.first;
// 1
onesyLinkedList.last;
// 4
const value = onesyLinkedList.search(4);
// OnesyNode { value: 4, ... }
onesyLinkedList.remove(1);
onesyLinkedList.first;
// 4
onesyLinkedList.length;
// 1
Dev
Install
yarn
Test
yarn test
Prod
Build
yarn build