Superfast Software Inc. was founded last year by three young programmers. They a
ID: 3814015 • Letter: S
Question
Superfast Software Inc. was founded last year by three young programmers. They all dreamed their company would become a really big one and would distribute a large number of software products all over the world. Thus, they decided to use 64-bit integers to represent their inventory codes. Since it is just a one-year-old company, the inventory database now contains only 2000 distinct product codes, in the range from 1 to 3000. At this time they need to sort these codes and one of the co-founders suggests using a general comparison-based O(nlogn)-time sorting algorithm such as heap-sort. But another co-founder disagrees and suggests using radix-exchange sort because it is a so-called ”linear time” (that is, O(n)) algorithm. Do you think radix exchange sort is good for this case? Explain your answer.
Explanation / Answer
Radix exchange sort is good in this case ,because this problem has fixed size keys (64 bit ). Also the algorithm is faster since log(N) is significantly larger than K, where K is the number of radix digits.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.