Time and Space complexity of Radix Sort Algorithm Last Updated : 09 Feb, 2024 Comments Improve Suggest changes Like Article Like Report The Radix Sort Algorithm has a time complexity of O(n*d), where n is the number of elements in the input array and d is the number of digits in the largest number. The space complexity of Radix Sort is O(n + k), where n is the number of elements in the input array and k is the range of the input. This algorithm is efficient for sorting integers, especially when the range of values is not significantly larger than the number of elements to be sorted. ComplexityRadix Sort AlgorithmTime ComplexityO(n*d)Space ComplexityO(n + k) Let's explore the detailed time and space complexity of the Radix Sort Algorithm: Time Complexity of Radix Sort Algorithm:Best Case Time Complexity: O(n*d) The best-case time complexity of Radix Sort is O(n*d), where n is the number of elements in the input array and d is the number of digits in the largest number.In the best case, Radix Sort performs similarly to the average case, as it processes all digits of all elements.Average Case Time Complexity: O(n*d) The average-case time complexity of Radix Sort is O(n*d).Radix Sort processes each digit of each element in the input array, making its time complexity linear with respect to the number of elements and digits.Worst Case Time Complexity: O(n*d) The worst-case time complexity of Radix Sort is O(n*d).In the worst case, when all elements have the same digits or the digits are in reverse order, Radix Sort still needs to process each digit of each element.Auxiliary Space of Radix Sort Algorithm:The space complexity of Radix Sort is O(n + k), where n is the number of elements in the input array and k is the range of the input.Radix Sort requires additional space for the buckets used during sorting and for storing the sorted output.The space complexity can be higher when dealing with a large range of input values. Comment More infoAdvertise with us Next Article Time and Space complexity of Radix Sort Algorithm T tarunsarawgi_gfg Follow Improve Article Tags : Analysis of Algorithms DSA Data Structures and Algorithms-QnA Similar Reads Time and Space Complexity Analysis of Quick Sort The time complexity of Quick Sort is O(n log n) on average case, but can become O(n^2) in the worst-case. The space complexity of Quick Sort in the best case is O(log n), while in the worst-case scenario, it becomes O(n) due to unbalanced partitioning causing a skewed recursion tree that requires a 4 min read Time and Space complexity analysis of Selection Sort The Selection sort algorithm has a time complexity of O(n^2) and a space complexity of O(1) since it does not require any additional memory space apart from a temporary variable used for swapping. Time Complexity Analysis of Selection Sort:Best-case: O(n2), best case occurs when the array is already 2 min read Time and Space Complexity Analysis of Bubble Sort The time complexity of Bubble Sort is O(n^2) in the worst-case scenario and the space complexity of Bubble sort is O(1). Bubble Sort only needs a constant amount of additional space during the sorting process. Complexity TypeComplexityTime ComplexityBest: O(n)Average: O(n^2)Worst: O(n^2)Space Comple 3 min read Time and Space Complexity Analysis of Merge Sort The Time Complexity of Merge Sort is O(n log n) in both the average and worst cases. The space complexity of Merge sort is O(n). AspectComplexityTime ComplexityO(n log n)Space ComplexityO(n)Time Complexity Analysis of Merge Sort:Consider the following terminologies: T(k) = time taken to sort k eleme 2 min read Time and Space Complexity Analysis of Binary Search Algorithm Time complexity of Binary Search is O(log n), where n is the number of elements in the array. It divides the array in half at each step. Space complexity is O(1) as it uses a constant amount of extra space. Example of Binary Search AlgorithmAspectComplexityTime ComplexityO(log n)Space ComplexityO(1) 3 min read Like