Top MCQs on RadixSort Algorithm with Answers

The lower bound for Comparison based sorting algorithm (Merge Sort, Heap Sort, Quick-Sort .. etc) is Ω(nLogn), i.e., they cannot do better than nLogn.

Counting sort is a linear time sorting algorithm that sort in O(n+k) time when elements are … More on Radix Sort

Radix Sort

Radix Sort


Question 1
Given an array where numbers are in range from 1 to n6, which sorting algorithm can be used to sort these number in linear time?
Cross
Not possible to sort in linear time
Tick
Radix Sort
Cross
Counting Sort
Cross
Quick Sort


Question 1-Explanation: 
See Radix Sort for explanation.
Question 2

If we use Radix Sort to sort n integers in the range (nk/2,nk], for some k>0 which is independent of n, the time taken would be?

Cross

Θ(n)

Cross

Θ(kn)

Tick

Θ(nlogn)

Cross

Θ(n2)



Question 2-Explanation: 

Radix sort time complexity = O(w*n)
for n keys of word size = w 
=>w = log(nk
O(w*n) = O(k*log(n).n) 
=> kO(n*log(n))

Question 3
If there are n integers to sort, each integer has d digits, and each digit is in the set {1, 2, ..., k}, radix sort can sort the numbers in:
Cross
O (k (n + d))
Tick
O (d (n + k))
Cross
O ((n + k) lg d)
Cross
O ((n + d) lg k)


Question 3-Explanation: 
If there are n integers to sort, each integer has d digits, and each digit is in the set {1, 2, ..., k}, radix sort can sort the numbers in O(d (n + k)). For more information Refer:Radix Sort Option (B) is correct.
Question 4
If there are n integers to sort, each integer has d digits and each digit is in the set {1, 2, ..., k}, radix sort can sort the numbers in :
Cross
O(d n k)
Cross
O(d nk)
Cross
O((d +n) k)
Tick
O(d (n + k))


Question 5
The maximum number of comparisons needed to sort 9 items using radix sort is (assume each item is 5 digit octal number):
Cross
45
Cross
72
Cross
360
Tick
450


There are 5 questions to complete.

 

Coding practice for sorting.

 


  • Last Updated : 27 Sep, 2023

Share your thoughts in the comments
Similar Reads