InterviewSolution
Saved Bookmarks
| 1. |
What is the average time complexity of counting sort? A) O(n)B) O(n+k) k=range of inputC) O(n^2)D) O(n log n) |
|
Answer» O(N+k)Explanation: Time complexity of counting SORT is O(n+k) as counting the OCCURRENCE of each element in the input range takes k time and then finding the CORRECT index value of each element in the sorted array takes n time. |
|