Linked list
Very simple code Modern code Junior friendly Typescript Made with 💛
yarn add @onesy/linked-list
- Implementation of stacks
- Efficient removal of elements
- Reduced memory fragmentation
- etc.
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
Install
yarn
Test
yarn test
Build
yarn build