@@ -1852,7 +1852,7 @@ def partition(array, lower, upper):
1852
1852
1853
1853
return array
1854
1854
1855
- def _count_sort_for_radix (array , exp , comp ):
1855
+ def _count_sort_for_radix (array , exp ):
1856
1856
n = len (array )
1857
1857
output = [None ] * n
1858
1858
count = [0 ] * 10
@@ -1876,7 +1876,7 @@ def _count_sort_for_radix(array, exp, comp):
1876
1876
for i in range (n ):
1877
1877
array [i ] = output [i ]
1878
1878
1879
- def radix_sort (array , comp = lambda u , v : u <= v , ** kwargs ):
1879
+ def radix_sort (array , ** kwargs ):
1880
1880
"""
1881
1881
Implements Radix Sort.
1882
1882
@@ -1911,13 +1911,13 @@ def radix_sort(array, comp=lambda u, v: u <= v, **kwargs):
1911
1911
# Perform counting sort on the sub_array (without None values)
1912
1912
exp = 1
1913
1913
while max_val // exp > 0 :
1914
- _count_sort_for_radix (sub_array , exp , comp )
1914
+ _count_sort_for_radix (sub_array , exp )
1915
1915
exp *= 10
1916
1916
1917
1917
# Insert None values back at their respective positions
1918
1918
sorted_array = sub_array [:]
1919
1919
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
1921
1921
1922
1922
# Update the original array with the sorted values
1923
1923
for i in range (start , end + 1 ):
0 commit comments