Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem 3. (12 marks) Recall that in a binary tree each node has at most 2 children. Suppose T is a binary tree with T-n

image text in transcribed

Problem 3. (12 marks) Recall that in a binary tree each node has at most 2 children. Suppose T is a binary tree with T-n (i.e. has n nodes). For every node v we use L and R, to denote the left subtree and right subtree of u, respectively. We say the subtree rooted at u is nearly balanced if Ru / Lu 2 i.e. the sizes of the two subtrees are within a factor two of each other a. (5 marks) Suppose that the root of T is nearly balanced. What is the maximum height of T in terms of n? Explain why. b. (7 marks) We say the whole tree is nearly balanced if for every node v of T, the subtree rooted at v is nearly balanced. Denote h as the height of T. Show that if T is nearly balanced then h e O(log n) by first showing that h 1083 n1

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

Modern Database Management

Authors: Donald A. Carpenter Fred R. McFadden

1st Edition

8178088045, 978-8178088044

More Books

Students also viewed these Databases questions

Question

2 0 4 8 bonacci code javq

Answered: 1 week ago

Question

What is human nature?

Answered: 1 week ago