Closed schun99 closed 4 years ago
Yes, I think so!
Feel free to refer to https://en.wikipedia.org/wiki/Radix_sort#Most_significant_digit,_forward_recursive
@schun99
one for counting number of elements in each bucket after the first sort and the other for sorting only certain range of given array using sub buckets.
Yes, these two functions could be helpful. Also, to speed up you can skip certain buckets during iteration.
I am still working on where to put recursive method to sort within the sub buckets. Is this a valid approach?
Recursion sometimes might be hard to implement and debug. If recursion is not necessary (from textbook it seems to me not), please feel free to try iteration based implementation.
Thank you so much :)
https://github.com/schun99/dsa-java/blob/master/src/main/java/edu/emory/cs/sort/distribution/RadixSortQuiz.java
Hi, I am not sure if I am on the right track. I created two auxiliary methods, one for counting number of elements in each bucket after the first sort and the other for sorting only certain range of given array using sub buckets. I am still working on where to put recursive method to sort within the sub buckets. Is this a valid approach?