Answered step by step
Verified Expert Solution
Question
1 Approved Answer
6. [A simple proof 10 points]. A perfect binary tree of height h is defined recursively as follows: an empty tree is a perfect binary
6. [A simple proof 10 points]. A perfect binary tree of height h is defined recursively as follows: an empty tree is a perfect binary tree of height -1. a non-empty tree consisting of a root r, and left and right subtrees Ti and TR, is a perfect binary tree of height h if and only if TL and TR are perfect binary trees of height h - (a) (2 points) Draw the perfect binary trees of height 0, , 2, and 3 on the lines blow. b) (3 points) Give an expression for the total number of nodes in a perfect binary tree of height h (c) (5 points) Prove that your answer to part (b) is correct by induction: Consider an arbitrary perfect binary tree of height h If h1 then the expression in part (b) gives: which is the number of nodes in a tree of height 1 otherwise, if h > -1 then we denote our tree by a root r together with subtrees TL and TR. By an inductive hypothesis that says: we have nodes in TL and nodes in TR nodes, which was what we wanted to for a total of prove
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started