Open faheel opened 2 years ago
there are two issues here.
I can post the fix to the first one, this makes code like this work
vector<int> arr{ 1, 8, 5, 12, 3 };
radix_sort(arr, 1, true);
return 0;
but crashes with (negative array indexes get generated by get_digit)
vector<int> arr{ 1, 8, -5, 12, 3 };
radix_sort(arr, 1, true);
return 0;
the second one is tougher. Two choices
I have verified that if I change the test harness to only generate >=0 values it works fine
one way to fix would be
I have coded this up, works fine
Radix sort seems to be broken as pointed out in #430