Question: a. Suppose that each leaf of TA is labeled with the probability that it is reached given a random input. Prove that exactly n! Leaves
a. Suppose that each leaf of TA is labeled with the probability that it is reached given a random input. Prove that exactly n! Leaves are labeled 1/n! And that the rest are labeled 0.
b. Let D(T) denote the external path length of a decision tree T ; that is, D(T) is the sum of the depths of all the leaves of T. Let T be a decision tree with k > 1 leaves, and let LT and RT be the left and right sub trees of T. Show that D(T) = D(LT) + D(RT) + k.
f. Show that for any randomized comparison sort B, there exists a deterministic comparison sort A that makes no more comparisons on the average than B does.
Step by Step Solution
3.46 Rating (191 Votes )
There are 3 Steps involved in it
a For a comparison algorithm A to sort no two input permutations can reach the same leaf of the decision tree so there must be at least n Leaves reach... View full answer
Get step-by-step solutions from verified subject matter experts
Document Format (1 attachment)
C-S-A (88).docx
120 KBs Word File
