Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem 2: Formulate a recursive definition for i(T), the number of internal vertices in a full binary tree T. An internal vertex is a vertex

Problem 2: Formulate a recursive definition for i(T), the number of internal vertices in a full binary tree T. An internal vertex is a vertex that has children. image text in transcribed
PLEASE READ THESE INSTRUCTIONS BEFORE YOU START THE PROBLEMS BELOW In the proofs to follow, you may use the recursive definitions above, as well a s the recursive definitions t(t) in Problems 1 & 2 below. for h(T) and n(T) given in the textbook, and your definitions for I(T) MUST DO NOT use the properties proved in the problems below in the proofs of other problems. YOU DO EACH PROOF EROM SCRATCH using the recursive definitions for complete binary tree, balanced binary tree, h(T), n(T), I(T) and i(t). Hint: the set of complete binary trees is a subset of the set of full binary trees. Problem 1: (5 points) Formulate a recursive definition for ICT), the number of leaves in a full binary tree T A leaf is a vertex that has no children. Problem 2: (5 points) Formulate a recursive definition for i(T), the number of internal vertices in a full binary tree T. An internal vertex is a vertex that has children. Problen 3: (5 points) Draw the complete binary trees formed by 0, 1 and 2 applications of the recursive step of the recursive definition above. Problem 4: (10 points) Draw the balanced binary trees formed by 0, 1 and 2 applications of the recursive step of the recursive definition above. For the 2ad application, draw 10 trees. (You don't have to draw t complete set of trees generated by the 2d application.) Problem 5: (5 points) A full and balanced binary tree is a full binary tree in which every leaf is either at level l or I-1 for some positive integer I. Write a recursive definition for the set of full and balanced binary trees. Problem 6: (10 points) Draw ALL of the full and balanced binary trees formed by 0, 1,2, and 3 applications of the recursive step of the recursive definition above. Problem Z: (10 points) Use structural induction to prove that the number of leaves, I(T), in a complete binary Problem 83 1o points) Use structural induction to prove that the height, hC, of a complete binary tree T with I(T) leaves is h(T)-log2 (T). Problem 9: (10 points) Use structural induction to prove that the number of internal vertices, iCT), of a full binary tree Tof height h(T) is i(T) S 2h()-1 Problem 10: (10 points) Use structural induction to prove that the number of internal vertices, i(T), of a complete binary tree T of height h(T) is i(T) 2hCT) - 1. Problem 11: (10 points) Note: please give CLOSED formulas (similar to the formulas given in Problen through Problem 10 above). Do not give recursive formulas for this exercise (Part 1) Deduce a formula for n(T), the total number of vertices of a complete binary tree T, as a functi of height h(T) (Part 2) Deduce a formula for n(T), the total number of vertices of a complete binary tree T, as a functi f the number of internal vertices, iCT). (Part 3) Deduce a formula for n(T), the total number of vertices of a complete binary tree T, as a funct the number of leaves, l(T). oblem 12: (10 points) Use structural induction to prove that the formula you deduced in Problem 11 formula 1 above for n(T) as a function of h(T) is correct

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David Kroenke, David Auer, Scott Vandenberg, Robert Yoder

9th Edition

0135188148, 978-0135188149, 9781642087611

More Books

Students also viewed these Databases questions

Question

Compare the three types of VPN.

Answered: 1 week ago