Skip to content

amerani/struct-ts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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();

usage (node)

const { DoublyLinkedList } = require('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)
head
tail
length

Stack

push(1)
pop()
peek()

Queue

enqueue(1)
dequeue()
peek()
length

BinarySearchTree

root
size
min()
max()
search(1)
insert(1, 100)
delete(1)
traverse(()=>{})