Problem 5. Superfast Software Inc. was founded last year by three young programm
ID: 3739125 • Letter: P
Question
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 answerExplanation / Answer
Answer is as follwos :
Yes, We are completely agree with this i.e. Radix Sort is good as compared to Heap Sort For given situation.
We know that there are fixed number of records i.e. 3000 so, Radix sort is much faster than heap soort in fixed length optimization.
So the Radix sort sort these elements in linear time.No doubt that heap sort can take less memory space to execute but it takes more time. So for saving time in this situation we can use Radix Sort.
Ans the major problem is that we have the data set of 64 bit as large, suppose one value in record corresponding to 1258966774532 etc. than heap sort does not fit this into memory. There will be huge complications.
So for large data set time complexity can be more. So to avoid this problem we also use Radix Sort or Merge Sort.
So from above we get the Radix Sort is best in such case.
if there is any query please ask in comments...