Show that the expected depth of thenbspkth smallest element


1. Show the following regarding the maximum item in the heap:

a. It must be at one of the leaves.

b. There are exactly fN/21 leaves.

c. Every leaf must be examined to ?nd it.

2. Show that the expected depth of the kth smallest element in a large complete heap (you may assume N  = 2k  - 1) is bounded by log k.

3. a. Give an algorithm to ?nd all nodes less than some value, X, in a binary heap. Your algorithm should run in O(K), where is the number of nodes output.

b. Does your algorithm extend to any of the other heap structures discussed in this chapter?

c.  Give an algorithm that ?nds an arbitrary item in a binary heap using at most roughly 3N/4 comparisons.

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: Show that the expected depth of thenbspkth smallest element
Reference No:- TGS01274635

Expected delivery within 24 Hours