Back to All Algorithms
Binary Search Tree
Category: Tree / Graph | Time: O(log n) Avg | Space: O(h) Avg
Visualization
Visual representation of the data structure
Enter tree data to start visualization.
About Binary Search Tree

A node-based binary tree data structure which has the following properties: the left subtree of a node contains only nodes with keys lesser than the node's key; the right subtree of a node contains only nodes with keys greater than the node's key; the left and right subtree each must also be a binary search tree.

Code Editor
The code is for reference. Editing it won't affect the visualization.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Frequently Asked Questions
About Binary Search Tree (BST)