Socket
Book a DemoInstallSign in
Socket

js-singly-linked-list

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

js-singly-linked-list

Singly Linked List Implemented in Javascript

1.0.1
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

Singly-Linked-List

Javascript Implementation of Singly Linked List

Installation & Usage :


npm install js-singly-linked-list


 const SinglyLinkedList = require('js-singly-linked-list');
 let list = new SinglyLinkedList();

 list.push(1); //Pushes value to the list
 list.pop(); // Delete value from the end of the list
 list.shift(); // Delete value from the start of the list
 list.unshift(1); // Adds value at the start of the list
 list.get(1); // Retrives value at the given index
 list.reverse(); // Reverses the list
 list.insert(1, 20); // list.insert(index, value) -> Inserts value at the given index
 list.set(1, 12); // list.set(index, value) ->  Replaces or set's value at the given index
 list.length; // Gives you length of the list
 list.head; // Gives you head of the list
 list.tail; // Gives you tail of the list

Keywords

DataStruture

FAQs

Package last updated on 16 Oct 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.