Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

5. The set of full binary trees is defined recursively in Definition 5 on page 353: Basis step: A single vertex r is a rooted

image text in transcribed

5. The set of full binary trees is defined recursively in Definition 5 on page 353: Basis step: A single vertex r is a rooted tree. Recursive step: If T and T2 are disjoint full binary trees, there is a full binary tree, denoted by Ti T2, consisting of a (new) root r together with edges connecting this root to the roots of the left subtree T and the right subtree T2. The set of leaves and the set of internal vertices of a full binary tree can also be defined recursively (page 395): Basis step: The root r is a leaf of the full binary tree with exactly one vertex r. This tree has no internal vertices. Recursive step: The set of leaves of the tree T = Ti T2 is the union of the sets of leaves of Ti and of T2. The internal vertices of T are the root r of T and the union of the set of internal vertices of T1 and the set of internal vertices of T2 (a.) Come up with a formula for the maximum number of nodes (vertices) in a full binary tree that is built up by applying the recursive step n times. Prove your formula using structural induction. (b.) Let T be a full binary tree. Let L(T) denote the number of leaves in T, and I(T) denote the number of internal vertices in T. Use structural induction to prove that L(T) = 1+ I(T). 5. The set of full binary trees is defined recursively in Definition 5 on page 353: Basis step: A single vertex r is a rooted tree. Recursive step: If T and T2 are disjoint full binary trees, there is a full binary tree, denoted by Ti T2, consisting of a (new) root r together with edges connecting this root to the roots of the left subtree T and the right subtree T2. The set of leaves and the set of internal vertices of a full binary tree can also be defined recursively (page 395): Basis step: The root r is a leaf of the full binary tree with exactly one vertex r. This tree has no internal vertices. Recursive step: The set of leaves of the tree T = Ti T2 is the union of the sets of leaves of Ti and of T2. The internal vertices of T are the root r of T and the union of the set of internal vertices of T1 and the set of internal vertices of T2 (a.) Come up with a formula for the maximum number of nodes (vertices) in a full binary tree that is built up by applying the recursive step n times. Prove your formula using structural induction. (b.) Let T be a full binary tree. Let L(T) denote the number of leaves in T, and I(T) denote the number of internal vertices in T. Use structural induction to prove that L(T) = 1+ I(T)

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

Data Analysis In Microsoft Excel

Authors: Alex Holloway

1st Edition

B0CCCPKTTX, 979-8852388452

More Books

Students also viewed these Databases questions