Answer:
Step-by-step explanation:
a. Swapping two adjacent elements that are out of place removes only one inversion.
Answer: True
b. Any algorithm that sorts by exchanging adjacent elements requires O(n log n)
Answer: False
c. Shellsort with a proper distance function is faster than mergesort for a very large input (like sorting 1 billion numbers).
Answer: True
d. The average-case performance of quick sort is O(NlogN), but the best-case performance of quick sort is O(N) for a pre-sorted input.
Answer: True
e. The number of leaves in a decision tree for sorting n numbers by comparisons must be 2n.
Answer: False
f. The height of a decision tree for sorting gives the minimum number of comparisons in the best case.
Answer: True
g. Any decision tree that can sort n elements must have height Big-Omega (n log n).
h. Bucket-sort can be modeled by a decision tree.
Answer: True