@loupthibault/linkedlist
v0.1.3
Published
Javascript Linked List
Downloads
168
Readme
Linked List
A Javascript Linked List.
Getting started
Install
npm i @loupthibault/linkedlist
Usage
import LinkedList from '@loupthibault/linkedlist';
// Create Linkedlist
const linkedlist = new LinkedList();
// Add values to linked list
[0, 1, 2, 3, 4, 5].forEach(value => linkedlist.push(value));
// Parse linked list
var node = linkedlist.head;
while(node) {
console.log(node.data);
node = node.next;
}
License
MIT.
Copyright (c) 2021, Loup-Rodolphe THIBAULT.