Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(20 points) Let A be a heap of size n. Let T be the binary tree corresponding to A (that is, A[1] is the root

image text in transcribed

(20 points) Let A be a heap of size n. Let T be the binary tree corresponding to A (that is, A[1] is the root node of T,A[2] and A[3] are the left child and right child node of A[1], etc). Prove the following properties of T (you need to pay attention to the floor notation in the equations). (a) The height of T is logn; (b) T is a balanced binary tree, namely if we denote the two subtrees of the root node of T by TL and TR respectively, then TRTL2n/3 (In fact, you have just proved a more general statement: the inequality holds for any non-leaf node in the tree) ; (c) The leaf nodes of T are A[n/2+1],A[n/2+2],,A[n]

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

The Database Experts Guide To SQL

Authors: Frank Lusardi

1st Edition

0070390029, 978-0070390027

More Books

Students also viewed these Databases questions