Radix Sort
BigO
This algorithm's best, worst, and average would be O(wn)
because w
is only the count of the longest word. Even though we have a nested loop we're not just growing and counting for every number in the list. But rather we take the loop ONLY by the amount of the longest digit count.
Notes
Because we're sorting numbers based on the amount of characters how do we know which characters we need to know from the beginning?
We'd have to at least traverse through the array once to denote the amount of characters that we need in order to start moving them through buckets?
Wouldn't we also need to do a nested loop as we move through the buckets?
Radix Sort Helpers
We need something that gets the appropriate digit based on the digits provided and the current view location
We take the items based on it's location, but we can do it based on Math information
Last updated