solist-js

Self-organizing list using the transpose heuristic

Usage no npm install needed!

<script type="module">
  import solistJs from 'https://cdn.skypack.dev/solist-js';
</script>

README

solist-js

Self-organizing list using the transpose heuristic

Installation

npm install solist-js

Example

var SOList = require('solist-js');

// Create new list.
var list = new SOList();

list.size(); // Returns number of elements in list.
list.empty(); // Returns true if list is empty. False otherwise.
list.get(key); // Returns element at key or undefined if not found. Expects key to be a String.
list.insert(key, foo); // Adds key with value foo. Expects key to be a String, and value to be of any type.
list.remove(key); // Deletes key and its value from the list. Expects key to be a string.

Test

npm run test