1.2.0 • Published 4 years ago

@hyperinactive/data-structs-js v1.2.0

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

data-structs-js

Implementation of common data structures into Javascript.

Structures included in the package:

- Stack
- Queue
- Singly linked list
- Doubly linked list
- Binary search tree
- AVL tree
- Hash table
- Hash map
- Min heap
- Max heap
- Graph

Instalation

npm install @hyperinactive/data-structs-js

Usage

Simply import a data structure from the module

e.g. const { Stack } = require('@hyperinactive/data-structs-js');

List of functions per structure

Stack

  • push
  • pop
  • getIndex
  • peek
  • reverse
  • isEmpty
  • length
  • clone
  • print

Queue

  • enqueue
  • dequeue
  • peek
  • poll
  • isEmpty
  • size
  • clone
  • print

Singly and Doubly linked list

  • getHead
  • getTail (Doubly)
  • getSize
  • add
  • removeByIndex
  • removeByValue
  • indexOf
  • forEach
  • clear
  • reverse
  • isEmpty
  • clone
  • print

Binary search and AVL tree

  • insert
  • remove
  • getDepth
  • getHeight
  • find
  • getMinNode
  • getMaxNode
  • clone
  • print

Hash table and map

  • put
  • get
  • remove
  • update
  • union
  • getCurrentLoad
  • getSize
  • forEach
  • clone
  • print

Min and max heap

  • insert
  • remove
  • heapify
  • peek
  • getSize
  • getParent
  • getLeftChild
  • getRightChild
  • isLeaf
  • swap
  • clear
  • print

Graph

  • addVertex
  • addEdge
  • removeVertex
  • removeEdge
  • removeAllEdges
  • bfs
  • dfs
  • print
1.2.0

4 years ago

1.1.9

4 years ago

1.1.8

4 years ago

1.1.7

4 years ago