/bst

Primary LanguageJavaScript

Binary Search Tree (BST) Project

This project implements a Binary Search Tree (BST) in JavaScript, providing a basic framework for performing various tree operations such as insertion, deletion, and traversal. The implementation showcases the ability to maintain a balanced tree and offers utility functions for tree manipulation and visualization.

Features

  • Tree Construction: Build a binary search tree from an array of random values.
  • Tree Operations: Perform basic tree operations like insertion, deletion, and finding minimum values.
  • Tree Traversal: Support for various tree traversal methods including in-order, pre-order, post-order, and level-order.
  • Tree Balancing: Check if the tree is balanced and rebalanced the tree if necessary.
  • Visualization: Pretty print the tree structure to the console for easy visualization.

Getting Started

To get started with this project, clone the repository and ensure you have Node.js installed on your system.