Answered step by step
Verified Expert Solution
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
(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
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