Socket
Book a DemoInstallSign in
Socket

@woftis/linked-list

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@woftis/linked-list

A JS implementation of linked lists

2.0.0
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Linked List

Methods

MethodsDescription
sizeReturn the current list size
headReturn the current head object
tailReturn the tail (last) object
toStringReturn list of objects as a string in format ( value ) -> ( value ) -> ( value ) -> null
at(index)Return the object at a given index of the list
appendNode(value)Add a new item at the end of the list. Accepts the value of the node you want to add
prependNode(value)Add a new item at the start of the list (replacing the head). Accepts the value of the node you want to add
popRemove the last item from the list
contains(value)Returns true if the list contains the passed value, else returns false
find(value)Returns the index number of the value if the list contains the passed value, else returns null
insertAt(index, value)Adds value to the specified index position of the list. If 0 is provided, it will prepend to the head, if index is greater than list size it will append to the tail
removeAt(index)Removes value from the specified index position of the list. If 0 is provided, it will remove the head, if index is greater than list size it will return null

FAQs

Package last updated on 08 Dec 2022

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.