menu
techminis

A naukri.com initiative

google-web-stories
Home

>

Programming News

>

Tree data ...
source image

Prodevelopertutorial

3w

read

179

img
dot

Image Credit: Prodevelopertutorial

Tree data structure tutorial 4. Binary Search Tree Introduction

  • Binary Search Tree [BST] is a tree, where the data will be placed in a particular order.
  • In a binary tree, for each node, if the value of all the nodes in the left sub tree is lesser and the value of all the nodes in the right sub tree is greater, then such binary tree is called as Binary Search Tree.
  • Searching for an element in BST involves checking the root node, moving towards left or right based on the comparison with the current node's value, until the search element is found.
  • Inserting an element in a BST involves comparing the value of the element with each node, moving towards the left sub tree or the right sub tree, until an empty position is found and inserting the element there.

Read Full Article

like

10 Likes

For uninterrupted reading, download the app