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 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? Not possible to sort in linear time Radix Sort Counting Sort Quick Sort

Question 1-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? Θ(n) Θ(kn) Θ(nlogn) Θ(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: O (k (n + d)) O (d (n + k)) O ((n + k) lg d) 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 : O(d n k) O(d nk) O((d +n) k) 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): 45 72 360 450

There are 5 questions to complete.

## Coding practice for sorting.

• Last Updated : 27 Sep, 2023