SlideShare a Scribd company logo
Rooted & Binary Tree
Dr. Manish T I
Associate Professor
Dept of CSE
Adi Shankara Institute of Engineering & Technology, Kalady
manish.cs@adishankara.ac.in
• A Binary tree is defined as a tree in which there is
exactly one vertex of degree two, and each of the
remaining vertices is of degree one or three.
Introduction
• A Tree in which one vertex is distinguished from
all the others is called a Rooted tree
• A special class of rooted trees called Binary Rooted
trees.
VERTICES
a - Internal vertex
b - Pendant vertex
c- Internal vertex
d - Pendant vertex
e- Internal vertexe- Internal vertex
f - Pendant vertex
g - Pendant vertex
EDGES
1,2,3,4,5,6
Properties of Binary Tree
The number of vertices n in a binary tree is always odd.
n No: of Vertices in binary tree
p=(n+1)/2 No: of Pendant vertices in binary tree.
n-p-1 Number of vertices with degree three.
n-1 Number of edges .
p-1 Number of internal vertices in binary tree.
Properties of Binary Tree
From the previous diagram n=7 i.e. a odd number
Number of edges = 7-1 =6
No: of Pendant vertices in binary tree = (7+1)/2 =4
No: of vertices with degree three = 7-4-1 =2No: of vertices with degree three = 7-4-1 =2
Number of edges = 7-1 =6
Number of internal vertices in binary tree = 4-1 =3
Properties of Binary Tree
2k
Maximum number of vertices possible in k-level binary tree.
⌈ log2
(n+1) -1 ⌉ Minimum possible height of an n – vertex binary tree.⌈ ⌉
(n-1)/2 Maximum possible height of an n – vertex binary tree.
Properties of Binary Tree
From the previous diagram k=4
Max No: of vertices possible in k-level binary tree = 24
= 16
⌈⌈⌈⌈ ⌉⌉⌉⌉Min possible height of an 7 – vertex binary tree = ⌈⌈⌈⌈ log2 (7+1) -1 ⌉⌉⌉⌉
= ⌈⌈⌈⌈ log2 (8) -1 ⌉⌉⌉⌉ = ⌈⌈⌈⌈ 3 -1 ⌉⌉⌉⌉ = 2
Max possible height of an 7 – vertex binary tree = (7-1)/2 = 4
Ad

More Related Content

What's hot (20)

Graphs In Data Structure
Graphs In Data StructureGraphs In Data Structure
Graphs In Data Structure
Anuj Modi
 
Context free grammar
Context free grammarContext free grammar
Context free grammar
Radhakrishnan Chinnusamy
 
Asymptotic Notation and Complexity
Asymptotic Notation and ComplexityAsymptotic Notation and Complexity
Asymptotic Notation and Complexity
Rajandeep Gill
 
Semantic Analysis.pptx
Semantic Analysis.pptxSemantic Analysis.pptx
Semantic Analysis.pptx
ZarfaMasood
 
Strassen's matrix multiplication
Strassen's matrix multiplicationStrassen's matrix multiplication
Strassen's matrix multiplication
Megha V
 
Lexical Analysis - Compiler Design
Lexical Analysis - Compiler DesignLexical Analysis - Compiler Design
Lexical Analysis - Compiler Design
Akhil Kaushik
 
Code optimization in compiler design
Code optimization in compiler designCode optimization in compiler design
Code optimization in compiler design
Kuppusamy P
 
PRIM’S AND KRUSKAL’S ALGORITHM
PRIM’S AND KRUSKAL’S  ALGORITHMPRIM’S AND KRUSKAL’S  ALGORITHM
PRIM’S AND KRUSKAL’S ALGORITHM
JaydeepDesai10
 
Lecture 4 asymptotic notations
Lecture 4   asymptotic notationsLecture 4   asymptotic notations
Lecture 4 asymptotic notations
jayavignesh86
 
implementation of travelling salesman problem with complexity ppt
implementation of travelling salesman problem with complexity pptimplementation of travelling salesman problem with complexity ppt
implementation of travelling salesman problem with complexity ppt
AntaraBhattacharya12
 
Best,worst,average case .17581556 045
Best,worst,average case .17581556 045Best,worst,average case .17581556 045
Best,worst,average case .17581556 045
university of Gujrat, pakistan
 
Graph algorithm
Graph algorithmGraph algorithm
Graph algorithm
University of Potsdam
 
Elliptic Curve Cryptography
Elliptic Curve CryptographyElliptic Curve Cryptography
Elliptic Curve Cryptography
JorgeVillamarin5
 
Sequence and Series in Discrete Structure
Sequence and Series in Discrete Structure Sequence and Series in Discrete Structure
Sequence and Series in Discrete Structure
Zain Abid
 
Unit I - Evaluation of expression
Unit I - Evaluation of expressionUnit I - Evaluation of expression
Unit I - Evaluation of expression
DrkhanchanaR
 
Splay Tree
Splay TreeSplay Tree
Splay Tree
Dr Sandeep Kumar Poonia
 
Parsing
ParsingParsing
Parsing
ShrikantSharma86
 
Unit -I Toc.pptx
Unit -I Toc.pptxUnit -I Toc.pptx
Unit -I Toc.pptx
viswanath kani
 
Information and data security pseudorandom number generation and stream cipher
Information and data security pseudorandom number generation and stream cipherInformation and data security pseudorandom number generation and stream cipher
Information and data security pseudorandom number generation and stream cipher
Mazin Alwaaly
 
Polynomial reppresentation using Linkedlist-Application of LL.pptx
Polynomial reppresentation using Linkedlist-Application of LL.pptxPolynomial reppresentation using Linkedlist-Application of LL.pptx
Polynomial reppresentation using Linkedlist-Application of LL.pptx
Albin562191
 
Graphs In Data Structure
Graphs In Data StructureGraphs In Data Structure
Graphs In Data Structure
Anuj Modi
 
Asymptotic Notation and Complexity
Asymptotic Notation and ComplexityAsymptotic Notation and Complexity
Asymptotic Notation and Complexity
Rajandeep Gill
 
Semantic Analysis.pptx
Semantic Analysis.pptxSemantic Analysis.pptx
Semantic Analysis.pptx
ZarfaMasood
 
Strassen's matrix multiplication
Strassen's matrix multiplicationStrassen's matrix multiplication
Strassen's matrix multiplication
Megha V
 
Lexical Analysis - Compiler Design
Lexical Analysis - Compiler DesignLexical Analysis - Compiler Design
Lexical Analysis - Compiler Design
Akhil Kaushik
 
Code optimization in compiler design
Code optimization in compiler designCode optimization in compiler design
Code optimization in compiler design
Kuppusamy P
 
PRIM’S AND KRUSKAL’S ALGORITHM
PRIM’S AND KRUSKAL’S  ALGORITHMPRIM’S AND KRUSKAL’S  ALGORITHM
PRIM’S AND KRUSKAL’S ALGORITHM
JaydeepDesai10
 
Lecture 4 asymptotic notations
Lecture 4   asymptotic notationsLecture 4   asymptotic notations
Lecture 4 asymptotic notations
jayavignesh86
 
implementation of travelling salesman problem with complexity ppt
implementation of travelling salesman problem with complexity pptimplementation of travelling salesman problem with complexity ppt
implementation of travelling salesman problem with complexity ppt
AntaraBhattacharya12
 
Elliptic Curve Cryptography
Elliptic Curve CryptographyElliptic Curve Cryptography
Elliptic Curve Cryptography
JorgeVillamarin5
 
Sequence and Series in Discrete Structure
Sequence and Series in Discrete Structure Sequence and Series in Discrete Structure
Sequence and Series in Discrete Structure
Zain Abid
 
Unit I - Evaluation of expression
Unit I - Evaluation of expressionUnit I - Evaluation of expression
Unit I - Evaluation of expression
DrkhanchanaR
 
Information and data security pseudorandom number generation and stream cipher
Information and data security pseudorandom number generation and stream cipherInformation and data security pseudorandom number generation and stream cipher
Information and data security pseudorandom number generation and stream cipher
Mazin Alwaaly
 
Polynomial reppresentation using Linkedlist-Application of LL.pptx
Polynomial reppresentation using Linkedlist-Application of LL.pptxPolynomial reppresentation using Linkedlist-Application of LL.pptx
Polynomial reppresentation using Linkedlist-Application of LL.pptx
Albin562191
 

Similar to Rooted & binary tree (20)

DSA IV Unit.pptx
DSA IV Unit.pptxDSA IV Unit.pptx
DSA IV Unit.pptx
AyeshaTakreem1
 
Weak 13 Trees, BST update.pptxhjjujjjhhhy
Weak 13 Trees, BST update.pptxhjjujjjhhhyWeak 13 Trees, BST update.pptxhjjujjjhhhy
Weak 13 Trees, BST update.pptxhjjujjjhhhy
baloch4551701
 
Binary Trees
Binary TreesBinary Trees
Binary Trees
Sadaf Ismail
 
Tree
TreeTree
Tree
Raj Sarode
 
Lec6
Lec6Lec6
Lec6
Nikhil Chilwant
 
7.tree
7.tree7.tree
7.tree
Chandan Singh
 
Basics of Binary Tree and Binary Search Tree.pptx
Basics of Binary Tree and Binary Search Tree.pptxBasics of Binary Tree and Binary Search Tree.pptx
Basics of Binary Tree and Binary Search Tree.pptx
BhagyashriKotame2
 
Introduction To Binary Search Trees .ppt
Introduction To Binary Search Trees .pptIntroduction To Binary Search Trees .ppt
Introduction To Binary Search Trees .ppt
mixedbangladesh
 
Chapter 5_Trees.pdf
Chapter 5_Trees.pdfChapter 5_Trees.pdf
Chapter 5_Trees.pdf
ssuser50179b
 
Unit iii(dsc++)
Unit iii(dsc++)Unit iii(dsc++)
Unit iii(dsc++)
Durga Devi
 
Review session2
Review session2Review session2
Review session2
NEEDY12345
 
Lecture 8 data structures and algorithms
Lecture 8 data structures and algorithmsLecture 8 data structures and algorithms
Lecture 8 data structures and algorithms
Aakash deep Singhal
 
Tree
TreeTree
Tree
knightofheart
 
Unit 6 tree
Unit   6 treeUnit   6 tree
Unit 6 tree
Dabbal Singh Mahara
 
Lecture 10.pptx
Lecture 10.pptxLecture 10.pptx
Lecture 10.pptx
SamiAAli44
 
tutorial-tree (3).ppt
tutorial-tree (3).ppttutorial-tree (3).ppt
tutorial-tree (3).ppt
SrinivasanCSE
 
Trees in Data Structure
Trees in Data StructureTrees in Data Structure
Trees in Data Structure
Om Prakash
 
B.TECH Math project
B.TECH Math projectB.TECH Math project
B.TECH Math project
arunsarkar9
 
Chap 5 Tree.ppt
Chap 5 Tree.pptChap 5 Tree.ppt
Chap 5 Tree.ppt
shashankbhadouria4
 
Chapter 8 ds
Chapter 8 dsChapter 8 ds
Chapter 8 ds
Hanif Durad
 
Ad

More from MANISH T I (20)

Budgerigar
BudgerigarBudgerigar
Budgerigar
MANISH T I
 
NAAC Criteria 3
NAAC  Criteria 3NAAC  Criteria 3
NAAC Criteria 3
MANISH T I
 
Artificial intelligence - An Overview
Artificial intelligence - An OverviewArtificial intelligence - An Overview
Artificial intelligence - An Overview
MANISH T I
 
The future of blogging
The future of bloggingThe future of blogging
The future of blogging
MANISH T I
 
Socrates - Most Important of his Thoughts
Socrates - Most Important of his ThoughtsSocrates - Most Important of his Thoughts
Socrates - Most Important of his Thoughts
MANISH T I
 
Technical writing
Technical writingTechnical writing
Technical writing
MANISH T I
 
Shannon-Fano algorithm
Shannon-Fano algorithmShannon-Fano algorithm
Shannon-Fano algorithm
MANISH T I
 
Solar Image Processing
Solar Image Processing  Solar Image Processing
Solar Image Processing
MANISH T I
 
Graph Theory Introduction
Graph Theory IntroductionGraph Theory Introduction
Graph Theory Introduction
MANISH T I
 
JPEG
JPEGJPEG
JPEG
MANISH T I
 
Colourful Living - Way of Life
Colourful Living - Way of LifeColourful Living - Way of Life
Colourful Living - Way of Life
MANISH T I
 
Introduction to Multimedia
Introduction to MultimediaIntroduction to Multimedia
Introduction to Multimedia
MANISH T I
 
Soft Computing
Soft ComputingSoft Computing
Soft Computing
MANISH T I
 
Research Methodology - Methods of data collection
 Research Methodology - Methods of data collection Research Methodology - Methods of data collection
Research Methodology - Methods of data collection
MANISH T I
 
15 lessons of lord buddha
15 lessons of lord buddha15 lessons of lord buddha
15 lessons of lord buddha
MANISH T I
 
Image enhancement
Image enhancementImage enhancement
Image enhancement
MANISH T I
 
Research Methodology - Introduction
Research  Methodology - IntroductionResearch  Methodology - Introduction
Research Methodology - Introduction
MANISH T I
 
DBMS - FIRST NORMAL FORM
DBMS - FIRST NORMAL FORMDBMS - FIRST NORMAL FORM
DBMS - FIRST NORMAL FORM
MANISH T I
 
Simple Dictionary Compression
Simple Dictionary CompressionSimple Dictionary Compression
Simple Dictionary Compression
MANISH T I
 
Data Compression - Text Compression - Run Length Encoding
Data Compression - Text Compression - Run Length EncodingData Compression - Text Compression - Run Length Encoding
Data Compression - Text Compression - Run Length Encoding
MANISH T I
 
NAAC Criteria 3
NAAC  Criteria 3NAAC  Criteria 3
NAAC Criteria 3
MANISH T I
 
Artificial intelligence - An Overview
Artificial intelligence - An OverviewArtificial intelligence - An Overview
Artificial intelligence - An Overview
MANISH T I
 
The future of blogging
The future of bloggingThe future of blogging
The future of blogging
MANISH T I
 
Socrates - Most Important of his Thoughts
Socrates - Most Important of his ThoughtsSocrates - Most Important of his Thoughts
Socrates - Most Important of his Thoughts
MANISH T I
 
Technical writing
Technical writingTechnical writing
Technical writing
MANISH T I
 
Shannon-Fano algorithm
Shannon-Fano algorithmShannon-Fano algorithm
Shannon-Fano algorithm
MANISH T I
 
Solar Image Processing
Solar Image Processing  Solar Image Processing
Solar Image Processing
MANISH T I
 
Graph Theory Introduction
Graph Theory IntroductionGraph Theory Introduction
Graph Theory Introduction
MANISH T I
 
Colourful Living - Way of Life
Colourful Living - Way of LifeColourful Living - Way of Life
Colourful Living - Way of Life
MANISH T I
 
Introduction to Multimedia
Introduction to MultimediaIntroduction to Multimedia
Introduction to Multimedia
MANISH T I
 
Soft Computing
Soft ComputingSoft Computing
Soft Computing
MANISH T I
 
Research Methodology - Methods of data collection
 Research Methodology - Methods of data collection Research Methodology - Methods of data collection
Research Methodology - Methods of data collection
MANISH T I
 
15 lessons of lord buddha
15 lessons of lord buddha15 lessons of lord buddha
15 lessons of lord buddha
MANISH T I
 
Image enhancement
Image enhancementImage enhancement
Image enhancement
MANISH T I
 
Research Methodology - Introduction
Research  Methodology - IntroductionResearch  Methodology - Introduction
Research Methodology - Introduction
MANISH T I
 
DBMS - FIRST NORMAL FORM
DBMS - FIRST NORMAL FORMDBMS - FIRST NORMAL FORM
DBMS - FIRST NORMAL FORM
MANISH T I
 
Simple Dictionary Compression
Simple Dictionary CompressionSimple Dictionary Compression
Simple Dictionary Compression
MANISH T I
 
Data Compression - Text Compression - Run Length Encoding
Data Compression - Text Compression - Run Length EncodingData Compression - Text Compression - Run Length Encoding
Data Compression - Text Compression - Run Length Encoding
MANISH T I
 
Ad

Recently uploaded (20)

How to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of saleHow to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of sale
Celine George
 
Presentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem KayaPresentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem Kaya
MIPLM
 
LDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini UpdatesLDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini Updates
LDM Mia eStudios
 
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public SchoolsK12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
dogden2
 
2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx
contactwilliamm2546
 
Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025
Mebane Rash
 
Anti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptxAnti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptx
Mayuri Chavan
 
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Library Association of Ireland
 
Introduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe EngineeringIntroduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe Engineering
Damian T. Gordon
 
Operations Management (Dr. Abdulfatah Salem).pdf
Operations Management (Dr. Abdulfatah Salem).pdfOperations Management (Dr. Abdulfatah Salem).pdf
Operations Management (Dr. Abdulfatah Salem).pdf
Arab Academy for Science, Technology and Maritime Transport
 
SPRING FESTIVITIES - UK AND USA -
SPRING FESTIVITIES - UK AND USA            -SPRING FESTIVITIES - UK AND USA            -
SPRING FESTIVITIES - UK AND USA -
Colégio Santa Teresinha
 
Sinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_NameSinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_Name
keshanf79
 
Political History of Pala dynasty Pala Rulers NEP.pptx
Political History of Pala dynasty Pala Rulers NEP.pptxPolitical History of Pala dynasty Pala Rulers NEP.pptx
Political History of Pala dynasty Pala Rulers NEP.pptx
Arya Mahila P. G. College, Banaras Hindu University, Varanasi, India.
 
Geography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjectsGeography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjects
ProfDrShaikhImran
 
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar RabbiPresentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Md Shaifullar Rabbi
 
To study the nervous system of insect.pptx
To study the nervous system of insect.pptxTo study the nervous system of insect.pptx
To study the nervous system of insect.pptx
Arshad Shaikh
 
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACYUNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
DR.PRISCILLA MARY J
 
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Library Association of Ireland
 
New Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptxNew Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptx
milanasargsyan5
 
How to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odooHow to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odoo
Celine George
 
How to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of saleHow to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of sale
Celine George
 
Presentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem KayaPresentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem Kaya
MIPLM
 
LDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini UpdatesLDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini Updates
LDM Mia eStudios
 
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public SchoolsK12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
dogden2
 
2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx
contactwilliamm2546
 
Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025
Mebane Rash
 
Anti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptxAnti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptx
Mayuri Chavan
 
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Library Association of Ireland
 
Introduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe EngineeringIntroduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe Engineering
Damian T. Gordon
 
Sinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_NameSinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_Name
keshanf79
 
Geography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjectsGeography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjects
ProfDrShaikhImran
 
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar RabbiPresentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Md Shaifullar Rabbi
 
To study the nervous system of insect.pptx
To study the nervous system of insect.pptxTo study the nervous system of insect.pptx
To study the nervous system of insect.pptx
Arshad Shaikh
 
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACYUNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
DR.PRISCILLA MARY J
 
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Library Association of Ireland
 
New Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptxNew Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptx
milanasargsyan5
 
How to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odooHow to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odoo
Celine George
 

Rooted & binary tree

  • 1. Rooted & Binary Tree Dr. Manish T I Associate Professor Dept of CSE Adi Shankara Institute of Engineering & Technology, Kalady [email protected]
  • 2. • A Binary tree is defined as a tree in which there is exactly one vertex of degree two, and each of the remaining vertices is of degree one or three. Introduction • A Tree in which one vertex is distinguished from all the others is called a Rooted tree • A special class of rooted trees called Binary Rooted trees.
  • 3. VERTICES a - Internal vertex b - Pendant vertex c- Internal vertex d - Pendant vertex e- Internal vertexe- Internal vertex f - Pendant vertex g - Pendant vertex EDGES 1,2,3,4,5,6
  • 4. Properties of Binary Tree The number of vertices n in a binary tree is always odd. n No: of Vertices in binary tree p=(n+1)/2 No: of Pendant vertices in binary tree. n-p-1 Number of vertices with degree three. n-1 Number of edges . p-1 Number of internal vertices in binary tree.
  • 5. Properties of Binary Tree From the previous diagram n=7 i.e. a odd number Number of edges = 7-1 =6 No: of Pendant vertices in binary tree = (7+1)/2 =4 No: of vertices with degree three = 7-4-1 =2No: of vertices with degree three = 7-4-1 =2 Number of edges = 7-1 =6 Number of internal vertices in binary tree = 4-1 =3
  • 6. Properties of Binary Tree 2k Maximum number of vertices possible in k-level binary tree. ⌈ log2 (n+1) -1 ⌉ Minimum possible height of an n – vertex binary tree.⌈ ⌉ (n-1)/2 Maximum possible height of an n – vertex binary tree.
  • 7. Properties of Binary Tree From the previous diagram k=4 Max No: of vertices possible in k-level binary tree = 24 = 16 ⌈⌈⌈⌈ ⌉⌉⌉⌉Min possible height of an 7 – vertex binary tree = ⌈⌈⌈⌈ log2 (7+1) -1 ⌉⌉⌉⌉ = ⌈⌈⌈⌈ log2 (8) -1 ⌉⌉⌉⌉ = ⌈⌈⌈⌈ 3 -1 ⌉⌉⌉⌉ = 2 Max possible height of an 7 – vertex binary tree = (7-1)/2 = 4