Skip to content

vorpus/TreeJS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Binary Search Trees in JS

Live | Run Tests

A JavaScript implementation of two Binary Search Tree data structures.

  1. Binary Search Tree
  2. Red-Black Tree

Usage

Click on the Live link above and use the graphical interface to see the trees in action.

Commands

The following commands are available to construct BST's. The Red-Black Tree extends the BST so all of the above functions are also available.

add - Add a value or TreeNode object to the BST

clear - Resets root to null

print - Depth-first prints the tree

find - Locate a value (if the value is not found, locates the closest node)

deleteVal - Locate a node with given value and deletes it if found

min - Traverses tree for node with minimum value

About

Red-Black tree and Binary Search tree implemented in JS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published