542 views

1 Answer

Best answer
3 votes
3 votes
Given array is: 120 , 231 , 417 , 343 , 542 , 998 , 675 , 196.

Since radix sort starts sorting by the LSB and iteratively goes towards the MSB.

So, after one pass the array will look like this: 120 , 231 , 542 , 343 , 675 , 196 , 417 , 998.

Now in the second pass, we have to take care of the ties(when two digits are same) as there are digits which are same.

So, after second pass the array will look like this: 417 , 120 , 231 , 542 , 343 , 675 , 196 , 998.

Now we have to apply bubble sort on the entire array. So each adjacent elements a[i] and a[j] will be swapped if a[j] > a[i] and j > i.

So, the array will look like this: 120 , 231 , 417 , 343 , 542 , 196 , 675 , 998.

Hence option D.
selected by

Related questions

1 votes
1 votes
2 answers
1
Ravi Dubey asked Aug 2, 2018
829 views
Could a binary search tree be built using o(n lg n) comparisons in the comparisonmodel? Explain why or why not.
2 votes
2 votes
1 answer
2
pankaj_vir asked Mar 19, 2018
1,488 views
2 votes
2 votes
1 answer
3
worst_engineer asked Oct 7, 2015
5,541 views
Which of the following sorting methods will be the best if number of swapping done is the only measure of efficiencyI am getting Bubble sort , is it right ?
0 votes
0 votes
2 answers
4
reena_kandari asked Jan 10, 2017
527 views