This repository was created to be used as reference for Binary Search Tree implementation using JavaScript.
The Binary Search Tree class has the following methods:
- size: returns the size of the tree
- insert: inserts a new node in the correct position
- min: returns the min value of the BST
- max: returns the max value of the BST
- contains: checks if the value exists in the BST
- dfsIterative: Depth First Search - Iterative
- dfsInOrder: Depth First Search - Recursive - [left, root, right]
- dfsPreOrder: Depth First Search - Recursive - [root, left, right]
- dfsPostOrder: Depth First Search - Recursive - [left, right, root]
- bfs: Breadth First Search - Recursive
- invertTree: Inverts the BST
# Use the following command to execute the file:
node binary_tree.js
- NodeJS
π€ Paulo Victor da Silva
- Github: @twistershark
- LinkedIn: @paulovictorsilva
Give a βοΈ if this repo helped you!