Radix Sort — JavaScript implementation

  • Given a list of numbers
  • Find the maximum length among all numbers, that is, the largest number’s length
  • Start a loop from 0 up to the maximum length
    - i means the i-th position counting from the right
    - In each iteration, we sort the numbers by the digit at the specified i position.

Implementation

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store