recategorized by
1,452 views
0 votes
0 votes
To sort the following numbers which algorithm will suit the best                                             

(i) 1 to 100 integers (ii) 0 to 1000000 integers                                  

 a)bucket sort for both

b) (i)radix sort   (ii)quick sort

c) (i)quick sort (ii)merge sort                                                                                             

 d) (i) merge sort (ii)quick sort
recategorized by

2 Answers

Best answer
1 votes
1 votes
radix sorts time complexity is n (logn base b ) here base is 10 and if we convert 100 as 10^2 we get O(2*n) for radix sort hence efficient compared to others for integers from 0 to 100 and in second case quick sort is best as it doesnt speak anything about the input and it only speaks about the range the input can be in any order generally quicksort is considered "quick" in implementation as id doesnt use any auxilary arrays and is inplace  and it has no copying time like that of merge and the worst case can be avoided with randomised version of it hence 1. radix 2.quick sort
selected by
0 votes
0 votes

the option b is correct.

radix sort will take linear time.

quicksort will O(nlogn) time.

Related questions

0 votes
0 votes
0 answers
1
manikgupta123 asked May 29, 2019
881 views
In a microprocessor, size of register is generally:Lesser than the size of the data it operates onGreater than the size of the data it operates onEqual to the size of th...
0 votes
0 votes
0 answers
2
balchandar reddy san asked Apr 26, 2019
667 views
The exam date for ME CSE is on 15th and 26th may, the slot booking will open on 4th may. My query is that whether slots for ME CSE will be there on both the dates (15th &...
0 votes
0 votes
1 answer
3
Vivekk asked Feb 10, 2019
1,420 views
I have graduated from Electrical engineering in 2018. Am I eligible for Bits HD exam for admission in MTech (CS)??
0 votes
0 votes
0 answers
4