314 views
0 votes
0 votes
We know that radix sort's run time is $\Theta (d(n +k))$ where n is the no. of elements to be sorted, k is the range of individual digit of the elements ($k =O(n)$) and $d$ is the no. of digits in every element, which is assumed to be constant.
I am wondering that if we re-arrange any random list of elements to contain same constant no. of digits we will be able to achieve a $\Theta(n)$ time.

 

For eg.
5, 72, 99, 343, 2, 8999, 1765, 57, 554, 12

 

can be rearranged to

 

0005, 0072, 0099, 0343, 0002, 8999, 1765, 0057, 0554, 0012

 

now, here $d = 4$ (constant) and also $k= O(n)$ (0 to 9)

 

We can do this with any random arrangement of numbers and achieve a linear time,
Where am I wrong $?$

Please log in or register to answer this question.

Related questions

1 votes
1 votes
1 answer
1
gatecse asked Dec 9, 2020
640 views
Consider an array of positive integers between $123456$ to $876543$, which sorting algorithm can be used to sort these number in linear time?Impossible to sort in linear ...
1 votes
1 votes
2 answers
2
akash.dinkar12 asked Jun 28, 2019
1,100 views
Show how to sort $n$ integers in the range $0$ to $n^3-1$ in $O(n)$ time.
0 votes
0 votes
0 answers
3
akash.dinkar12 asked Jun 28, 2019
593 views
Use induction to prove that radix sort works. Where does your proof need the assumption that the intermediate sort is stable?
0 votes
0 votes
1 answer
4