Package Exports
- @incremunica/data-structures
- @incremunica/data-structures/lib/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@incremunica/data-structures) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Incremunica data structures
A collection of reusable data structures.
Install
$ yarn add @incremunica/data-structures
Usage
Queue
import { Queue } from '@incremunica/data-structures';
const queue = new Queue<number>();
queue.push(1);
queue.push(2);
console.log(queue.shift()); // 1
console.log(queue.shift()); // 2
DoublyLinkedList
import { DoublyLinkedList } from '@incremunica/data-structures';
const list = new DoublyLinkedList<number>();
list.push(1); // list: [ 1 ]
list.addAt(1, 2); // list: [ 1, 2 ]
list.unshift(0); // list: [ 0, 1, 2 ]
console.log(list.pop()); // prints: 2 list: [ 0, 1 ]
console.log(list.shift()); // prints: 0 list: [ 1 ]
console.log(list.deleteAt(0)); // prints: 1 list: [ ]