struct-ts
v0.1.3
Published
data structures in typescript
Downloads
3
Maintainers
Readme
struct-ts
data structure library written in typescript
installation
npm
npm install struct-ts
yarn
yarn add struct-ts
usage
import { DoublyLinkedList } from 'struct-ts';
const dll = new DoublyLinkedList();
dll.push(1).pop().unshift(1).shift();
library
DoublyLinkedList
of(arrayLike)
from(1, 2, 3)
push(1)
pop()
shift()
unshift(1)
insertBefore(node, 2)
insertAfter(node, 3)
remove(1)
removeNode(node)
find(1)
length
Stack
push(1)
pop()
peek()
Queue
enqueue(1)
dequeue()
peek()
length
BinarySearchTree
root
size
min()
max()
search(1, tree.root)
insert(1, 100, tree.root)
delete(1, tree.root)
traverse(console.log)