7
Most read
8
Most read
9
Most read
Binary Search Tree in Data
Structures
Prof. Neeraj Bhargava
Kapil Chauhan
Department of Computer Science
School of Engineering & Systems Sciences
MDS University, Ajmer
Introduction
 A binary search tree is a useful data structure for fast
addition and removal of data.
 It is composed of nodes, which stores data and also
links to upto two other child nodes.
 It is the relationship between the leaves linked to and
the linking leaf, also known as the parent node, which
makes the binary tree such an efficient data structure.
Cont…
 For a binary tree to be a binary search tree, the data of
all the nodes in the left sub-tree of the root node
should be less than the data of the root.
 The data of all the nodes in the right subtree of the
root node should be greater than equal to the data of
the root.
 As a result, the leaves on the farthest left of the tree
have the lowest values, whereas the leaves on the right
of the tree have the greatest values.
Binary Search Tree
Insertion in a BST
 To insert data into a binary tree involves a function
searching for an unused node in the proper position in
the tree in which to insert the key value.

 The insert function is generally a recursive function
that continues moving down the levels of a binary tree
until there is an unused leaf in a position which
follows the following rules of placing nodes.
Cont..
 Compare data of the root node and element to be
inserted.
 If the data of the root node is greater, and if a left
subtree exists, then repeat step 1 with root = root of
left subtree. Else,
 Insert element as left child of current root.
Cont..
 If the data of the root node is greater, and if a right
subtree exists, then repeat step 1 with root = root of
right subtree.
 Else, insert element as right child of current root.
BST Insertion
Assignment
 Explain Binary Search Tree in data structure with
suitable example and discuss basic operation.

More Related Content

PPTX
Binary Search Tree
PPTX
Active and Passive Listening- Presentation
PPT
Binary search tree(bst)
PPTX
Inheritance
PDF
Communication process
PDF
Simple rules of_tajweed
PPTX
Binary search tree deletion
PPTX
Republic Act 10175 - Cyber Crime Prevention Act of 2012
Binary Search Tree
Active and Passive Listening- Presentation
Binary search tree(bst)
Inheritance
Communication process
Simple rules of_tajweed
Binary search tree deletion
Republic Act 10175 - Cyber Crime Prevention Act of 2012

What's hot (20)

PPTX
Trees (data structure)
PPTX
Binary Tree in Data Structure
PDF
Binary search tree operations
PPTX
Tree in data structure
PPTX
PPT
1.1 binary tree
PPTX
Introduction to data structure ppt
PPTX
Linked List
PPTX
Binary Search Tree in Data Structure
PPTX
Binary Search Tree
PPT
Divide and conquer
PPTX
Abstract Data Types
PPTX
stack & queue
PPT
Queue data structure
PPT
Data Structure and Algorithms Binary Search Tree
PPTX
Priority queue in DSA
PPTX
queue & its applications
PPTX
Threaded Binary Tree.pptx
PPT
358 33 powerpoint-slides_11-efficient-binary-trees_chapter-11
PPTX
Heap tree
Trees (data structure)
Binary Tree in Data Structure
Binary search tree operations
Tree in data structure
1.1 binary tree
Introduction to data structure ppt
Linked List
Binary Search Tree in Data Structure
Binary Search Tree
Divide and conquer
Abstract Data Types
stack & queue
Queue data structure
Data Structure and Algorithms Binary Search Tree
Priority queue in DSA
queue & its applications
Threaded Binary Tree.pptx
358 33 powerpoint-slides_11-efficient-binary-trees_chapter-11
Heap tree
Ad

Similar to Binary search tree in data structures (20)

PDF
binarysearchtreeindatastructures-200604055006 (1).pdf
PPTX
Data- Structures-Binary-Search-Trees.pptx
PPTX
Introduction-to-Trees-in-Data-Structures-and-Algorithms[1].pptx
PPTX
Binary search tree definition operation.pptx
PPTX
UNIT III Non Linear Data Structures - Trees.pptx
PPTX
UNIT III Non Linear Data Structures - Trees.pptx
PDF
PPTX
nptel 2nd presentation.pptx
PPTX
9e28d06f-bae9-487e-8360-0e2c0a8c2972.pptx
PDF
Unit iv data structure-converted
PPTX
Trees data structure
PPT
Algorithm and Data Structure - Binary Trees
PPTX
4. Apply data structures such as arrays, linked lists, and trees as an abstra...
PPTX
Database Engine
DOCX
Biary search Tree.docx
PPT
Chapter 8: tree data structure
PDF
Makalah if2091-2011-020
PDF
Tree Data Structure by Daniyal Khan
PPTX
binarysearchtreeindatastructures-200604055006 (1).pdf
Data- Structures-Binary-Search-Trees.pptx
Introduction-to-Trees-in-Data-Structures-and-Algorithms[1].pptx
Binary search tree definition operation.pptx
UNIT III Non Linear Data Structures - Trees.pptx
UNIT III Non Linear Data Structures - Trees.pptx
nptel 2nd presentation.pptx
9e28d06f-bae9-487e-8360-0e2c0a8c2972.pptx
Unit iv data structure-converted
Trees data structure
Algorithm and Data Structure - Binary Trees
4. Apply data structures such as arrays, linked lists, and trees as an abstra...
Database Engine
Biary search Tree.docx
Chapter 8: tree data structure
Makalah if2091-2011-020
Tree Data Structure by Daniyal Khan
Ad

More from chauhankapil (20)

PPTX
Gray level transformation
PPTX
Elements of visual perception
PPTX
JSP Client Request
PPTX
Jsp server response
PPTX
Markov decision process
PPTX
RNN basics in deep learning
PPTX
Introduction to generative adversarial networks (GANs)
PPTX
Bayesian probabilistic interference
PPTX
PPTX
Exception handling in java
PPTX
Knowledge acquistion
PPTX
Knowledge based system
PPTX
Introduction of predicate logics
PPTX
Types of inheritance in java
PPTX
Representation of syntax, semantics and Predicate logics
PPTX
Inheritance in java
PPTX
Propositional logic
PPTX
Constructors in java
PPTX
Methods in java
PPT
Circular linked list
Gray level transformation
Elements of visual perception
JSP Client Request
Jsp server response
Markov decision process
RNN basics in deep learning
Introduction to generative adversarial networks (GANs)
Bayesian probabilistic interference
Exception handling in java
Knowledge acquistion
Knowledge based system
Introduction of predicate logics
Types of inheritance in java
Representation of syntax, semantics and Predicate logics
Inheritance in java
Propositional logic
Constructors in java
Methods in java
Circular linked list

Recently uploaded (20)

PDF
ASPEN PLUS USER GUIDE - PROCESS SIMULATIONS
PDF
Traditional Programming vs Machine learning and Models in Machine Learning
PPTX
Module 1 – Introduction to Computer Networks: Foundations of Data Communicati...
PPTX
Cloud Security and Privacy-Module-1.pptx
PDF
August 2025 Top read articles in International Journal of Database Managemen...
PPTX
L1111-Important Microbial Mechanisms.pptx
PPTX
highway-150803160405-lva1-app6891 (1).pptx
PDF
BBC NW_Tech Facilities_30 Odd Yrs Ago [J].pdf
PDF
ITEC 1010 - Networks and Cloud Computing
PPTX
22ME926Introduction to Business Intelligence and Analytics, Advanced Integrat...
PDF
PhD defense presentation in field of Computer Science
PDF
Software defined netwoks is useful to learn NFV and virtual Lans
PDF
CBCN cam bien cong nghiep bach khoa da năng
PPTX
IOP Unit 1.pptx for btech 1st year students
PPTX
sinteringn kjfnvkjdfvkdfnoeneornvoirjoinsonosjf).pptx
PDF
CB Công Nghiệp Slide .dh bách khoa đà nẵng
PPTX
240409 Data Center Training Programs by Uptime Institute (Drafting).pptx
PPTX
quantum theory on the next future in.pptx
PDF
B461227.pdf American Journal of Multidisciplinary Research and Review
PPT
Module_1_Lecture_1_Introduction_To_Automation_In_Production_Systems2023.ppt
ASPEN PLUS USER GUIDE - PROCESS SIMULATIONS
Traditional Programming vs Machine learning and Models in Machine Learning
Module 1 – Introduction to Computer Networks: Foundations of Data Communicati...
Cloud Security and Privacy-Module-1.pptx
August 2025 Top read articles in International Journal of Database Managemen...
L1111-Important Microbial Mechanisms.pptx
highway-150803160405-lva1-app6891 (1).pptx
BBC NW_Tech Facilities_30 Odd Yrs Ago [J].pdf
ITEC 1010 - Networks and Cloud Computing
22ME926Introduction to Business Intelligence and Analytics, Advanced Integrat...
PhD defense presentation in field of Computer Science
Software defined netwoks is useful to learn NFV and virtual Lans
CBCN cam bien cong nghiep bach khoa da năng
IOP Unit 1.pptx for btech 1st year students
sinteringn kjfnvkjdfvkdfnoeneornvoirjoinsonosjf).pptx
CB Công Nghiệp Slide .dh bách khoa đà nẵng
240409 Data Center Training Programs by Uptime Institute (Drafting).pptx
quantum theory on the next future in.pptx
B461227.pdf American Journal of Multidisciplinary Research and Review
Module_1_Lecture_1_Introduction_To_Automation_In_Production_Systems2023.ppt

Binary search tree in data structures

  • 1. Binary Search Tree in Data Structures Prof. Neeraj Bhargava Kapil Chauhan Department of Computer Science School of Engineering & Systems Sciences MDS University, Ajmer
  • 2. Introduction  A binary search tree is a useful data structure for fast addition and removal of data.  It is composed of nodes, which stores data and also links to upto two other child nodes.  It is the relationship between the leaves linked to and the linking leaf, also known as the parent node, which makes the binary tree such an efficient data structure.
  • 3. Cont…  For a binary tree to be a binary search tree, the data of all the nodes in the left sub-tree of the root node should be less than the data of the root.  The data of all the nodes in the right subtree of the root node should be greater than equal to the data of the root.  As a result, the leaves on the farthest left of the tree have the lowest values, whereas the leaves on the right of the tree have the greatest values.
  • 5. Insertion in a BST  To insert data into a binary tree involves a function searching for an unused node in the proper position in the tree in which to insert the key value.   The insert function is generally a recursive function that continues moving down the levels of a binary tree until there is an unused leaf in a position which follows the following rules of placing nodes.
  • 6. Cont..  Compare data of the root node and element to be inserted.  If the data of the root node is greater, and if a left subtree exists, then repeat step 1 with root = root of left subtree. Else,  Insert element as left child of current root.
  • 7. Cont..  If the data of the root node is greater, and if a right subtree exists, then repeat step 1 with root = root of right subtree.  Else, insert element as right child of current root.
  • 9. Assignment  Explain Binary Search Tree in data structure with suitable example and discuss basic operation.