New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

skiplist

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

skiplist

skiplist implementation for javascript

latest
Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
23
666.67%
Maintainers
1
Weekly downloads
 
Created
Source

A skiplist implementation in javascript

Because I wanted to understand skip lists.

npm Tests Coverage Status Dependencies

var assert = require('assert');
var Skiplist = require('skiplist');

var list = new Skiplist();
list.insert('cat', 'Cats are the best animal.');
list.insert('dog', 'Dogs are obviously inferior.');
list.insert('coati', 'Coatis have long tails.');

var value = list.match('cat');
assert(value === 'Cats are the best animal.');

var result = list.find('co');
assert(result.length === 2);
assert(result[0][0] === 'coati');
assert(result[1][0] === 'dog');

var wasRemoved = list.remove('dog');
assert(list.length() === 2);

See also

The Wikipedia entry on skip lists.

A Python implementation. Another one.

Keywords

data structures

FAQs

Package last updated on 01 Mar 2016

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