npm.io
0.0.1 • Published 2 years ago

@banshi/linked-list

Licence
MIT
Version
0.0.1
Deps
3
Size
22 kB
Vulns
0
Weekly
0

-banshi-linked-list

npm install @banshi/linked-list
import LinkedList, { Node } from "@banshi/linked-list";


let ls = new LinkedList<number>;


- add(4);
- add(2);
let third = new Node(3);
- add(third);
- add(5);

- add(new Node(6));

- printList();

Methods

  • List of Methods

  • add(Value) - Value or Node instance; let third = new Node(3);

  • add(third);

  • printList() - Pring List

  • breakCircular() - Break cercular list

  • isCircularList() - Check linked list is circular or not

  • prepend(Value/Node) - Prepend

  • insert(Value, index) -- Insert value at index

  • sort() - Sort list

Keywords