Problem 4. The scientists of Space Lab want to sort their remote sensoring data
ID: 3739124 • Letter: P
Question
Problem 4. The scientists of Space Lab want to sort their remote sensoring data to reconstruct the 3-D images of the surface of Mars. They have one million 64-bit integers to sort 1. If they use quicksort, estimate the number of key value comparisons per- formed. (Hint: consider the average time complexity of quicksort.) 2. If they treat these integers as four-digit, radix-216 numbers and use straight radix sort based on the radix-216 notation, how many sorting passes are required to do the sorting? 3·Unfortunately, the computer in the Space Lab has only 9 megabytes of available memory for running the sorting task. Is it practical to choose bucket sort to be the stable sorting method in the implementation of the above straight radix sort? Explain your answer.Explanation / Answer
ANSWER
GIVEN BY
1
digit of key value comparison performed = nlog n = 10^6 (log 10^6) = 6 10^6
2
For every number in a radix sort , we want to have a pass. We want to have 4 passes.
3
Radix sort is a established sort . So the sort is constant.
Hence,
it is impractical to choose the pail sort to be the stable sorting scheme in the implementation of the greater than radix sort.
x = a + 2^16 b + (2^16)2 c + (2^16)3 d
wherever
a,b,c etc every in range 0..9. These digits are simply small enough to do bucket genus
radix sort(L):
{
bucket sort by a
bucket sort by b
bucket sort by c
bucket sort by d
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.