SlideShare a Scribd company logo
1 of 14
SESSION – (2022-23)
A seminar
on
“BINARY TREE”
by
master of science in computer science
Guided by : Presented By :
Md. Afroj ansari Priyanka Yadav
(Ass. Professor of cs) Roll no : 06
Date : 17/10/2022
INDEX
 INTRODUCTION.
 BINARY TREE.
 UNLABELED BINARY TREE.
 LABELED BINARY TREE.
 TYPES OF BINARY TREE.
 Rooted Binary Tree.
 Full / Strictly Binary Tree.
 Complete / Perfect Binary Tree.
 Almost Complete Binary Tree.
 Skewed Binary Tree.
INTRODUCTION
Binary Data :
Binary tree is a special tree data structure in which
each node can have at most 2 children.Thus, in a binary tree, Each
node has either 0 child or 1 child or 2 children.
Example :
Unlabeled Binary Tree-
A binary tree is unlabeled if its nodes are not assigned any label.
Example-
Consider we want to draw all the binary trees possible with 3 unlabeled nodes.
Using the above formula, we have-
Number of binary trees possible with 3 unlabeled nodes
= 2 x 3C3 / (3 + 1)
= 6C3 / 4
= 5
Thus,
With 3 unlabeled nodes, 5 unlabeled binary trees are possible.
These unlabeled binary trees are as follows-
Labeled Binary Tree-
A binary tree is labeled if all its nodes are assigned a label.
Example-
Consider we want to draw all the binary trees possible with labeled nodes.
Using the above formula, we have-
Number of binary trees possible with 3 labeled nodes
= { 2 x 3C3 / (3 + 1) } x 3!
= { 6C3 / 4 } x 6
= 5 x 6
= 30
Thus,
With 3 labeled nodes, 30 labeled binary trees are possible.
Each unlabeled structure gives rise to 3! = 6 different labeled structures.
Types of binary tree
1. Rooted Binary Tree :
A rooted binary tree is a binary tree that satisfies the following 2 properties-
It has a root node.
Each node has at most 2 children.
Example-
2. Full / Strictly Binary Tree-
A binary tree in which every node has either 0 or 2 children is called as a Full
binary tree.
Full binary tree is also called as Strictly binary tree.
Example-
Here,
First binary tree is not a full binary tree.
This is because node C has only 1 child.
3. Complete / Perfect Binary Tree-
A complete binary tree is a binary tree that satisfies the following 2
properties-
Every internal node has exactly 2 children.
All the leaf nodes are at the same level.
Complete binary tree is also called as Perfect binary tree.
Example-
Here,
First binary tree is not a complete binary tree.
This is because all the leaf nodes are not at the same level.
4. Almost Complete Binary Tree-
An almost complete binary tree is a binary tree that satisfies the following 2
properties-
All the levels are completely filled except possibly the last level.
The last level must be strictly filled from left to right.
Example-
Here,
First binary tree is not an almost complete binary tree.
This is because the last level is not filled from left to right.
5. Skewed Binary Tree-
A skewed binary tree is a binary tree that satisfies the following 2 properties-
All the nodes except one node has one and only one child.
The remaining node has no child.
OR
A skewed binary tree is a binary tree of n nodes such that its depth is (n-1).
Example-
binary tree.pptx

More Related Content

More from SANJUSANJEEVTOPPO (9)

masterpages 1.pptx
masterpages 1.pptxmasterpages 1.pptx
masterpages 1.pptx
 
ppt2.pptx
ppt2.pptxppt2.pptx
ppt2.pptx
 
template c++.pptx
template c++.pptxtemplate c++.pptx
template c++.pptx
 
thread os.pptx
thread os.pptxthread os.pptx
thread os.pptx
 
ppt1.pptx
ppt1.pptxppt1.pptx
ppt1.pptx
 
Entrepreneurship CS.pptx
Entrepreneurship CS.pptxEntrepreneurship CS.pptx
Entrepreneurship CS.pptx
 
sampling RM.pptx
sampling RM.pptxsampling RM.pptx
sampling RM.pptx
 
C language.pptx
C language.pptxC language.pptx
C language.pptx
 
stack ppt.pptx
stack ppt.pptxstack ppt.pptx
stack ppt.pptx
 

Recently uploaded

General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Association for Project Management
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxcallscotland1987
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structuredhanjurrannsibayan2
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxAmanpreet Kaur
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 

Recently uploaded (20)

General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 

binary tree.pptx

  • 1. SESSION – (2022-23) A seminar on “BINARY TREE” by master of science in computer science Guided by : Presented By : Md. Afroj ansari Priyanka Yadav (Ass. Professor of cs) Roll no : 06 Date : 17/10/2022
  • 2. INDEX  INTRODUCTION.  BINARY TREE.  UNLABELED BINARY TREE.  LABELED BINARY TREE.  TYPES OF BINARY TREE.  Rooted Binary Tree.  Full / Strictly Binary Tree.  Complete / Perfect Binary Tree.  Almost Complete Binary Tree.  Skewed Binary Tree.
  • 3. INTRODUCTION Binary Data : Binary tree is a special tree data structure in which each node can have at most 2 children.Thus, in a binary tree, Each node has either 0 child or 1 child or 2 children. Example :
  • 4. Unlabeled Binary Tree- A binary tree is unlabeled if its nodes are not assigned any label.
  • 5. Example- Consider we want to draw all the binary trees possible with 3 unlabeled nodes. Using the above formula, we have- Number of binary trees possible with 3 unlabeled nodes = 2 x 3C3 / (3 + 1) = 6C3 / 4 = 5 Thus, With 3 unlabeled nodes, 5 unlabeled binary trees are possible. These unlabeled binary trees are as follows-
  • 6. Labeled Binary Tree- A binary tree is labeled if all its nodes are assigned a label.
  • 7. Example- Consider we want to draw all the binary trees possible with labeled nodes. Using the above formula, we have- Number of binary trees possible with 3 labeled nodes = { 2 x 3C3 / (3 + 1) } x 3! = { 6C3 / 4 } x 6 = 5 x 6 = 30 Thus, With 3 labeled nodes, 30 labeled binary trees are possible. Each unlabeled structure gives rise to 3! = 6 different labeled structures.
  • 9. 1. Rooted Binary Tree : A rooted binary tree is a binary tree that satisfies the following 2 properties- It has a root node. Each node has at most 2 children. Example-
  • 10. 2. Full / Strictly Binary Tree- A binary tree in which every node has either 0 or 2 children is called as a Full binary tree. Full binary tree is also called as Strictly binary tree. Example- Here, First binary tree is not a full binary tree. This is because node C has only 1 child.
  • 11. 3. Complete / Perfect Binary Tree- A complete binary tree is a binary tree that satisfies the following 2 properties- Every internal node has exactly 2 children. All the leaf nodes are at the same level. Complete binary tree is also called as Perfect binary tree. Example- Here, First binary tree is not a complete binary tree. This is because all the leaf nodes are not at the same level.
  • 12. 4. Almost Complete Binary Tree- An almost complete binary tree is a binary tree that satisfies the following 2 properties- All the levels are completely filled except possibly the last level. The last level must be strictly filled from left to right. Example- Here, First binary tree is not an almost complete binary tree. This is because the last level is not filled from left to right.
  • 13. 5. Skewed Binary Tree- A skewed binary tree is a binary tree that satisfies the following 2 properties- All the nodes except one node has one and only one child. The remaining node has no child. OR A skewed binary tree is a binary tree of n nodes such that its depth is (n-1). Example-