Back to Visualizer

Interactive Tree Builder

Tree Algorithm

Tree Operations

Binary Search Tree

Time Complexity:
Best: O(log n)
Average: O(log n)
Worst: O(n)
Space Complexity:O(n)
Description:

A Binary Search Tree (BST) is a hierarchical data structure where each node has at most two children. For every node, all values in the left subtree are smaller, and all values in the right subtree are larger than the node's value.

Instructions

• Enter a value and click + to add nodes

• Drag nodes to reposition them

• Double-click nodes to delete them

• Use mouse wheel to zoom in/out

• Click and drag background to pan

Drag nodes to move • Double-click to delete • Scroll to zoom
Add Node
Add nodes to get started