Data Structures, Algorithms, Java, Big O Notation, Searching And Sorting.
// order. for (int i = n - 1; i >= 0; i--) { output[count[arr[i]] - 1] = arr[i]; count[arr[i]]--; } // Copy the output array to arr, so that arr now // contains sorted characters for (int i = 0; i < n; i++) arr[i] = output[i]; } 4.9 Bucket sort The time complexity is O(n+k), as is the space