**0 to 1000000 integers: **since it is of a large set, quicksort will be efficient

**0 to 100 integers: **radix sort will be efficient

The Gateway to Computer Science Excellence

First time here? Checkout the FAQ!

x

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

+1 vote

Best answer

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

- All categories
- General Aptitude 1.3k
- Engineering Mathematics 5.4k
- Digital Logic 2.1k
- Programming & DS 3.9k
- Algorithms 3.4k
- Theory of Computation 4.2k
- Compiler Design 1.6k
- Databases 3.1k
- CO & Architecture 2.7k
- Computer Networks 3.1k
- Non GATE 1.1k
- Others 1.4k
- Admissions 501
- Exam Queries 448
- Tier 1 Placement Questions 19
- Job Queries 62
- Projects 12

37,976 questions

45,471 answers

131,383 comments

48,425 users