Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

linked-list

An implementation of the linked list data structure in JavaScript.

Running tests

npm install
npm test

The tests are written with Mocha using Chai as an assertion library.

License

WTFPL

API Reference

LinkedList

Kind: global class

new LinkedList()

A linked list data structure.

linkedList.length() ⇒ number

Get the length of the list.

Kind: instance method of LinkedList

linkedList.add(index) ⇒ void

Add a value to the list at the specified index.

Kind: instance method of LinkedList

Param Type
index number

linkedList.dump() ⇒ Array.<*>

Returns an array containing the elements of the list.

Kind: instance method of LinkedList

linkedList.get(index) ⇒ Node

Get the value at the specified index.

Kind: instance method of LinkedList

Param Type
index number

linkedList.removeAt(index)

Remove the value from the given index.

Kind: instance method of LinkedList

Param Type
index number

linkedList.removeLast()

Remove the last value from the list.

Kind: instance method of LinkedList

linkedList.removeFirst()

Remove the first value from the list.

Kind: instance method of LinkedList

About

Take that, professor!

Topics

Resources

License

Releases

No releases published

Packages

No packages published