BinarySearchTree: An Unbalanced Binary Search Tree
Discover how to search, add or remove an element in the BinarySearchTree.
A BinarySearchTree
is a special kind of binary tree in which each node,
u
, also stores a data value, u.x
, from some total order. The data values in a binary search tree obey the binary search tree property: For a node, u
, every data value stored in the subtree rooted at u.left
is less than u.x
and every data value stored in the subtree rooted at u.right
is greater than u.x
. An example of a BinarySearchTree
is shown below.
Create a free account to access the full course.
By signing up, you agree to Educative's Terms of Service and Privacy Policy