@@ -1852,7 +1852,7 @@ def partition(array, lower, upper):
18521852
18531853 return array
18541854
1855- def _count_sort_for_radix (array , exp , comp ):
1855+ def _count_sort_for_radix (array , exp ):
18561856 n = len (array )
18571857 output = [None ] * n
18581858 count = [0 ] * 10
@@ -1876,7 +1876,7 @@ def _count_sort_for_radix(array, exp, comp):
18761876 for i in range (n ):
18771877 array [i ] = output [i ]
18781878
1879- def radix_sort (array , comp = lambda u , v : u <= v , ** kwargs ):
1879+ def radix_sort (array , ** kwargs ):
18801880 """
18811881 Implements Radix Sort.
18821882
@@ -1911,13 +1911,13 @@ def radix_sort(array, comp=lambda u, v: u <= v, **kwargs):
19111911 # Perform counting sort on the sub_array (without None values)
19121912 exp = 1
19131913 while max_val // exp > 0 :
1914- _count_sort_for_radix (sub_array , exp , comp )
1914+ _count_sort_for_radix (sub_array , exp )
19151915 exp *= 10
19161916
19171917 # Insert None values back at their respective positions
19181918 sorted_array = sub_array [:]
19191919 for idx in none_indices :
1920- sorted_array .insert (idx - start , None ) # Insert None back at the correct position
1920+ sorted_array .insert (end , None ) # Insert None back at the correct position
19211921
19221922 # Update the original array with the sorted values
19231923 for i in range (start , end + 1 ):
0 commit comments