JSPM

just-another-linked-list

1.1.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q27483F
  • License ISC

A simple linked list implementation

Package Exports

  • just-another-linked-list
  • just-another-linked-list/LinkedList.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (just-another-linked-list) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

just-another-linked-list

A simple linked list implementation

Basic usage

import LinkedList from "./LinkedList.js";

const linkedList = new LinkedList();
//create with array
linkedList.create([1,2,3,4,5,6,7])

//get simple linkedlist representation 
linkedList.getAllValue() // returns a string

//Insert value at a particular index
linkedList.insertAtIndex(value,index)

//Pop value from linked list -> O(n)
linkedList.pop();

//insert at head of linked list
linkedList.insertAtHead(value)

//Get value at index
linkedList.getvalueAtIndex(index)

//Insert value at tail
linkedList.insertAtTail(value)

//remove from index
linkedList.removeAtIndex(index)

//pop method to remove element
linkedList.pop()

//convert linked list to array
linkedList.toArray()