Question:

The minimum possible time complexity to sort \(n\) integers in the range [1, \(n^2\)] is _______ .

Show Hint

For sorting a known range of values, non-comparison-based algorithms such as Counting Sort or Radix Sort can achieve linear time complexity.
Updated On: Jun 16, 2025
  • O(n)
  • O(n\log n)
  • O(n\(^2\))
  • O(\(\log n\))
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is A

Solution and Explanation

When sorting integers in the range [1, \(n^2\)], the minimum time complexity is \(O(n)\), achieved by using non-comparison-based algorithms like Counting Sort or Radix Sort. These algorithms can exploit the known range of values for sorting. Comparison-based algorithms like Merge Sort or Quick Sort have a lower bound of \(O(n \log n)\).
Was this answer helpful?
0
0