Binary Search Tree

Binary search tree is a data structure that quickly allows us to maintain a sorted list of numbers.

  • It is called a binary tree because each tree node has maximum of two children.
  • It is called a search tree because it can be used to search for the presence of a number in O(log(n)) time.

The properties that separates a binary search tree from a regular binary tree are:

  • All nodes of left subtree are less than root node
  • All nodes of right subtree are more than root node
  • Both subtrees of each node are also BSTs i.e. they have the above two properties
binary-search-tree-kotlin

Binary Search Tree - Visual of insertion Operation :

Subscribe to my youtube channel :


Operations on kotlin Binary Search Tree

Searching :

Finding the location of some specific element in a binary search tree.

Insertion :

Adding a new element to the binary search tree at the appropriate location so that the property of BST do not violate.

Deletion :

Deleting some specific node from a binary search tree. However, there can be various cases in deletion depending upon the number of children, the node have.

aaaaaaaaaaaaa
Comment / Suggestion Section
Point our Mistakes and Post Your Suggestions

Recent Addition

new tutorial Selenium Online Training : Our next online training course for Selenium with Java starts from 17th December 2018.

You can attend first 3 classes for free, the total course fee is INR 10,000

The course time would be 8.00 PM(IST) for the first three classes

If you are interested to learn, then you can join the course by sending email to chercher.tech@gmail.com

or Register below


 
Join My Facebook Group
Join Group