if a full binary tree has 36 internal vertices, how many leaves does it have?

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%

if a full binary tree has 36 internal vertices, how many leaves does it have?

152
4 Searching and Sorting
Theorem 4.2.3: If T is a full Binary Tree with m internal vertices, then T has
т+1 leaves
Proof. I/ by Strong Induction on m where m E {0.. }
Step 1. If m = 0, then T has a root vertex, r, but no internal vertices. Therefore,
3D
r must be a leaf and must be the only vertex in T.
// T has m +1 leaves.
Step 2. Assume 3k EN such that if 0 <=m <= k and if T is a full Binary Tree
with m internal vertices, then T has m + 1 leaves.
Step 3. Suppose now that T* is a full Binary Tree with k + 1 internal vertices.
// We must prove that T* has (k + 1) + 1 = k + 2 leaves.
Let r* denote the root of T*; r* cannot be a leaf, so must be an internal vertex with
exactly two vertices, u and v, below it in the diagram.
и
T2
The part of the diagram from u down is full Binary Tree T1 with ml internal
vertices, and the part of the diagram from v down is full Binary Tree T2 with m2
internal vertices. Since every internal vertex of T is either in T1 or in T2 or r*,
k+1 = m1 +m2+1
where both ml and m2 are nonnegative and <= k. Since every leaf of T is either a
leaf in T, or is a leaf in T2,
# leaves in T = # leaves in 71 + # leaves in T2
= m1 + 1
+ m2 + 1
= k + 2
The Most Important Ideas in This Section.
A Branching Diagram for an algorithm (sometimes called a “decision tree")
is a tree that shows all possible sequences of operations the algorithm might
do. Sometimes, constructing a portion of it is useful. We constructed the
Branching Diagram of probes for Binary Search when n= 12 displaying all
possible sequences of probes that it might make. That diagram was a Binary
Tree with 5 leaves and 7 internal vertices.
(continued)
Transcribed Image Text:152 4 Searching and Sorting Theorem 4.2.3: If T is a full Binary Tree with m internal vertices, then T has т+1 leaves Proof. I/ by Strong Induction on m where m E {0.. } Step 1. If m = 0, then T has a root vertex, r, but no internal vertices. Therefore, 3D r must be a leaf and must be the only vertex in T. // T has m +1 leaves. Step 2. Assume 3k EN such that if 0 <=m <= k and if T is a full Binary Tree with m internal vertices, then T has m + 1 leaves. Step 3. Suppose now that T* is a full Binary Tree with k + 1 internal vertices. // We must prove that T* has (k + 1) + 1 = k + 2 leaves. Let r* denote the root of T*; r* cannot be a leaf, so must be an internal vertex with exactly two vertices, u and v, below it in the diagram. и T2 The part of the diagram from u down is full Binary Tree T1 with ml internal vertices, and the part of the diagram from v down is full Binary Tree T2 with m2 internal vertices. Since every internal vertex of T is either in T1 or in T2 or r*, k+1 = m1 +m2+1 where both ml and m2 are nonnegative and <= k. Since every leaf of T is either a leaf in T, or is a leaf in T2, # leaves in T = # leaves in 71 + # leaves in T2 = m1 + 1 + m2 + 1 = k + 2 The Most Important Ideas in This Section. A Branching Diagram for an algorithm (sometimes called a “decision tree") is a tree that shows all possible sequences of operations the algorithm might do. Sometimes, constructing a portion of it is useful. We constructed the Branching Diagram of probes for Binary Search when n= 12 displaying all possible sequences of probes that it might make. That diagram was a Binary Tree with 5 leaves and 7 internal vertices. (continued)
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Types of trees
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education