Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

Binary Search Tree

Overview

A Binary Search Tree is a tree that follows some order to arrange the elements, whereas the binary tree does not follow any order. In a Binary Search Tree, the value of the left node must be smaller than the parent node, and the value of the right node must be greater than the parent node.

Advantages of Binary Tree

  1. Searching becomes very efficient in a binary search tree since, we get a hint at each step, about which sub-tree contains the desired element.
  2. The binary search tree is considered an efficient data structure in comparison to arrays and linked lists. Within respect to searching, the data structure allows us to remove half a sub-tree at every step. Searching for an element ina binary search tree takes O(log n) time. In its worst case, the time it takes to search an element is O(n).
  3. It also speeds up the insertion and deletion operations in comparison to arrays and linked lists.

Operations on a Binary Search Tree

Implementation of Binary Search Tree

  • Creation
  • Searching
  • Insertion
  • Deletion
  • Printing (Preorder, Inorder, Postorder)

See Also

Binary Search Tree