Linked list implementation written in JavaScript.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
test
.gitignore
README.md
index.js
package.json

README.md

linked-list

Linked list implementation written in JavaScript.

Usage

var LinkedList = require('./');

// Instantiate linked list object
var list = new LinkedList();

list.push('bird');
list.push('cat');
list.push('dog');

list.pop();  // 'dog'
list.pop();  // 'cat'
list.pop();  // 'bird'

API

LinkedList#push(data)

Adds a node with a data to the end of the list.

LinkedList#pop()

Removes the last node from the list and returns the data of that node.

Test

To run the test suit use npm test. This will call mocha test runner with parameters defined in package.json.

$ npm test

See also