Operations on Binary Search Trees

The most common operation performed on a binary search tree is searching for a key (value) stored in the tree. Binary search trees also support dynamic set operations like insertion and deletion.

In our examples, we show animations of the insertion and deletion operations mentioned above. Besides INSERT, DELETE, and FIND, the CLEAR operation deletes all the nodes of a binary search tree. Further explanation about each algorithm can be found under the different menu options. It is important to note that these operations can all be supported in time O(h) on a binary tree of height h, which is a major improvement over the binary search using a vector implementation (which takes O(n) time).

Operations


Previous Page
Next Page
Return to Main Page