Question

Problem 5. Superfast Software Inc. was founded last year by three young programmers. They all dreamed...

Problem 5. 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 sug-

gests 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.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Heap sort have time complexity of n*log(n) whereas in Radix Sort , time complexity is n*k (where k is the max. no. of digits in the number to be stored).

Since the range is from 1 to 3000 and number to be sorted are 2000. Mathematically , in Radix sort , time complexity will be = 2000*4 = 8000.

And in heap sort , time complexity will be = 2000*log(2000) = 6602.05999133.

So, i think Heap sort will be given preference over Radix sort.

Add a comment
Know the answer?
Add Answer to:
Problem 5. Superfast Software Inc. was founded last year by three young programmers. They all dreamed...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Superfast Software Inc. was founded last year by three young programmers. They all dreamed their company...

    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...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT