SlideShare a Scribd company logo
1 of 8
Binary Search Tree
Rohan
Mistry
Outlines
Tree
Obscure binarysearch trees BinarySearchTree
DifferencebetweenBTandBST
Applicationsof BST
Typesof BST
Trees
Tree
 Eachnode canhave0 or more children
 Annode canhaveat most one parent
Binarytree
 Treewith 0-2 children per node
 AlsoknownasDecisionMakingTree
Obscure binary search trees
Items, suchasnames, numbers, etc. canbe stored in memory
in asorted order called binarysearch trees or BSTs.And
someofthese datastructures canautomaticallybalancetheir
height whenarbitrary items are inserted or deleted.
Therefore, they are known as self-balancing BSTs. Further,
there can be different implementations of this type, like the
SplayTrees,A
VLtrees, andred-blacktrees.
Difference between BT and BST
Abinarytree issimplyatree in whicheachnode canhaveat
most two children.
ABinarysearchtree isatree that followssomeorder to
arrange the elements, whereasthe binarytree doesnot
followanyorder. InaBinarysearchtree, the valueofthe left
node must be smaller than the parent node, andthe valueof
the right node must be greater than the parent node.
Applications of BST
Used in many search applications where data is constantly
entering/leaving, such as the map and set objects in many
languageslibraries.
Storing a set of names, and being able to lookup based on a
prefix ofthe name. (Used in internet routers.)
Storing a path in a graph, and being able to reverse any
subsectionofthe path in O(log n) timr
Findingsquareroot ofgiven number
Types of BST
• AVLTree:- AVLtree isselfbalancingBinarySearchTreewhere
the differencebetweenheightsofleft andright subtrees cannot be
more than one for all nodes
• Red-BlackTree:- Ared-black tree isakindofself-balancing
binarysearchtree where eachnode hasanextra bit, andthat bit is
often interpreted asthe colour (red or black).These colours are
usedto ensure that the tree remains balancedduring insertions
and deletions
• SplayTree:- Asplaytree isabinarysearchtree with the additional
property that recently accessedelements are quickto accessagain.
Likeself-balancingbinarysearchtrees, asplaytree performs basic
operations suchasinsertion, look-upandremovalin O(log n)
amortized time.
Thank You

More Related Content

More from RohanMistry15

Artificial Intelligence - A modern approach 3ed
Artificial Intelligence - A modern approach 3edArtificial Intelligence - A modern approach 3ed
Artificial Intelligence - A modern approach 3ed
RohanMistry15
 

More from RohanMistry15 (20)

geographical-information-system question paper
geographical-information-system question papergeographical-information-system question paper
geographical-information-system question paper
 
Business-Intelligence question paper 2023
Business-Intelligence question paper 2023Business-Intelligence question paper 2023
Business-Intelligence question paper 2023
 
Aeronautical Engineering Career Information
Aeronautical Engineering Career InformationAeronautical Engineering Career Information
Aeronautical Engineering Career Information
 
Chinese Cyber attack on mumbai power plant
Chinese Cyber attack on mumbai power plantChinese Cyber attack on mumbai power plant
Chinese Cyber attack on mumbai power plant
 
Zeus learning
Zeus learningZeus learning
Zeus learning
 
Artificial Intelligence - A modern approach 3ed
Artificial Intelligence - A modern approach 3edArtificial Intelligence - A modern approach 3ed
Artificial Intelligence - A modern approach 3ed
 
Advanced Web Programming Chapter 8
Advanced Web Programming Chapter 8Advanced Web Programming Chapter 8
Advanced Web Programming Chapter 8
 
Advanced Web Programming Chapter 5
Advanced Web Programming Chapter 5Advanced Web Programming Chapter 5
Advanced Web Programming Chapter 5
 
Advanced Web Programming Chapter 4
Advanced Web Programming Chapter 4Advanced Web Programming Chapter 4
Advanced Web Programming Chapter 4
 
Advanced Web Programming Chapter 13 & 14
Advanced Web Programming Chapter 13 & 14Advanced Web Programming Chapter 13 & 14
Advanced Web Programming Chapter 13 & 14
 
Advanced Web Programming Chapter 12
Advanced Web Programming Chapter 12Advanced Web Programming Chapter 12
Advanced Web Programming Chapter 12
 
Advanced Web Programming Chapter 2
Advanced Web Programming Chapter 2Advanced Web Programming Chapter 2
Advanced Web Programming Chapter 2
 
Advanced Web Programming Chapter 3
Advanced Web Programming Chapter 3Advanced Web Programming Chapter 3
Advanced Web Programming Chapter 3
 
Advanced Web Programming Chapter 10
Advanced Web Programming  Chapter 10Advanced Web Programming  Chapter 10
Advanced Web Programming Chapter 10
 
Advanced Web Programming Chapter 11
Advanced Web Programming Chapter 11Advanced Web Programming Chapter 11
Advanced Web Programming Chapter 11
 
Advanced Web Programming Chapter 9
Advanced Web Programming Chapter 9Advanced Web Programming Chapter 9
Advanced Web Programming Chapter 9
 
Advanced Web Programming Chapter 6
Advanced Web Programming Chapter 6Advanced Web Programming Chapter 6
Advanced Web Programming Chapter 6
 
Advanced Web Programming Chapter 1
Advanced Web Programming Chapter 1Advanced Web Programming Chapter 1
Advanced Web Programming Chapter 1
 
Advanced Web Programming Chapter 7
Advanced Web Programming Chapter 7Advanced Web Programming Chapter 7
Advanced Web Programming Chapter 7
 
Linux 2022 Exam Question paper
Linux 2022 Exam Question paperLinux 2022 Exam Question paper
Linux 2022 Exam Question paper
 

Recently uploaded

The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 

Recently uploaded (20)

AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
 
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 

Binary Search Tree.pptx

  • 2. Outlines Tree Obscure binarysearch trees BinarySearchTree DifferencebetweenBTandBST Applicationsof BST Typesof BST
  • 3. Trees Tree  Eachnode canhave0 or more children  Annode canhaveat most one parent Binarytree  Treewith 0-2 children per node  AlsoknownasDecisionMakingTree
  • 4. Obscure binary search trees Items, suchasnames, numbers, etc. canbe stored in memory in asorted order called binarysearch trees or BSTs.And someofthese datastructures canautomaticallybalancetheir height whenarbitrary items are inserted or deleted. Therefore, they are known as self-balancing BSTs. Further, there can be different implementations of this type, like the SplayTrees,A VLtrees, andred-blacktrees.
  • 5. Difference between BT and BST Abinarytree issimplyatree in whicheachnode canhaveat most two children. ABinarysearchtree isatree that followssomeorder to arrange the elements, whereasthe binarytree doesnot followanyorder. InaBinarysearchtree, the valueofthe left node must be smaller than the parent node, andthe valueof the right node must be greater than the parent node.
  • 6. Applications of BST Used in many search applications where data is constantly entering/leaving, such as the map and set objects in many languageslibraries. Storing a set of names, and being able to lookup based on a prefix ofthe name. (Used in internet routers.) Storing a path in a graph, and being able to reverse any subsectionofthe path in O(log n) timr Findingsquareroot ofgiven number
  • 7. Types of BST • AVLTree:- AVLtree isselfbalancingBinarySearchTreewhere the differencebetweenheightsofleft andright subtrees cannot be more than one for all nodes • Red-BlackTree:- Ared-black tree isakindofself-balancing binarysearchtree where eachnode hasanextra bit, andthat bit is often interpreted asthe colour (red or black).These colours are usedto ensure that the tree remains balancedduring insertions and deletions • SplayTree:- Asplaytree isabinarysearchtree with the additional property that recently accessedelements are quickto accessagain. Likeself-balancingbinarysearchtrees, asplaytree performs basic operations suchasinsertion, look-upandremovalin O(log n) amortized time.