One strategy for deriving an algorithmic solution to a chall
One strategy for deriving an algorithmic solution to a challenging problem is to identify a special case that can be solved optimally and use it as a building block for a general solution. Which of the following special-case problems is exploited by Quicksort?
(a) Combining two sorted datasets into a single sorted dataset.
(b) Finding the sorted-order position of a given key within a unsorted dataset
(c) Computing the mean of an unsorted set of numbers.
(d) Mapping a given key to a random number that can be used as an index.
(e) Finding the largest or smallest key in an unsorted dataset.
(f) Solving the element distinctness problem.
(g) Solving the widest-separated pair problem
(h) Computing the nth-digit of pi.
Solution
Answer:
(a) Combining two sorted datasets into a single sorted dataset.
FALSE : It does not combine any sorted sigments like merge sort
(b) Finding the sorted-order position of a given key within a unsorted dataset
TRUE: Quicksort find correct position for PIVOT elements
(c) Computing the mean of an unsorted set of numbers.
TRUE: Quicksort can compute mean to choose PIVOT element
(d) Mapping a given key to a random number that can be used as an index.
(e) Finding the largest or smallest key in an unsorted dataset.
FALSE
(f) Solving the element distinctness problem.
TRUE: we can check this using QUICK soer that whether all elments are unique or not
(g) Solving the widest-separated pair problem
FALSE
(h) Computing the nth-digit of pi.
FALSE
