Utility Methods
Insert

Insert places a new node by comparing values, traversing left if smaller, right if greater, until an appropriate spot is found. Time complexity is O(h), h being the tree height. In a balanced tree, it's logarithmic for efficient inserts.

Delete

The algorithm starts at the root, traverses the tree based on comparisons, and recursively applies the deletion rules until the target node is removed. The time complexity of the BST delete operation is O(h), where h is the height of the tree. It will delete the subtree below the node.

Random Tree

Randomly inserts 10 nodes at a time following the insert method rules. You can continuously use this method to create a larger tree rather than inserting a single node at a time.

Clear

Clears all nodes from the tree. Leaving you with an empty root node to insert nodes onto.

BST Search
Depth First

Depth-First Search (DFS) is a graph traversal algorithm that explores as far as possible along each branch before backtracking. It starts at an initial node, visits adjacent nodes, and continues deeper until it reaches a leaf node. Then, it backtracks and explores other branches. DFS has a time complexity of O(V + E), where V is the number of vertices and E is the number of edges in the graph.

Breadth First

Breadth-First Search (BFS) is a graph traversal algorithm that systematically explores all the vertices at the current level before moving on to the next level. Starting from an initial node, BFS visits its neighbors, then the neighbors' neighbors, and so on, until all reachable nodes are visited. The time complexity of BFS is O(V + E), where V is the number of vertices, and E is the number of edges in the graph.

BST Sort
Pre-Order

Pre-order traversal is a tree traversal algorithm that visits each node in a specific order. In a binary tree, the pre-order traversal involves visiting the current node before its left and right subtrees. The algorithm starts at the root and follows the order: visit the current node, traverse the left subtree recursively, and then traverse the right subtree recursively.

In-Order

In-order traversal is a tree traversal algorithm that visits each node in a specific order. In a binary tree, the in-order traversal involves visiting the left subtree, then the current node, and finally the right subtree. The algorithm starts at the leftmost node and follows the order: traverse the left subtree recursively, visit the current node, and then traverse the right subtree recursively.

Post-Order

Post-order traversal is a tree traversal algorithm that visits each node in a specific order. In a binary tree, the post-order traversal involves visiting the left subtree, then the right subtree, and finally the current node. The algorithm starts at the root and follows the order: traverse the left subtree recursively, traverse the right subtree recursively, and finally visit the current node.