This notebook was prepared by Donne Martin. Source and license info is on GitHub.

# Challenge Notebook¶

## Constraints¶

• Is the input a list?
• Yes
• Can we assume the inputs are valid?
• Check for None in place of an array
• Assume array elements are ints
• Do we know the max digits to handle?
• No
• Are the digits base 10?
• Yes
• Can we assume this fits memory?
• Yes

## Test Cases¶

• None -> Exception
• [] -> []
• [128, 256, 164, 8, 2, 148, 212, 242, 244] -> [2, 8, 128, 148, 164, 212, 242, 244, 256]

## Algorithm¶

Refer to the Solution Notebook. If you are stuck and need a hint, the solution notebook's algorithm discussion might be a good place to start.

## Code¶

In [ ]:
class RadixSort(object):

def sort(self, array, base=10):
# TODO: Implement me
pass


## Unit Test¶

The following unit test is expected to fail until you solve the challenge.

In [ ]:
# %load test_radix_sort.py
import unittest

def test_sort(self):
array = [128, 256, 164, 8, 2, 148, 212, 242, 244]
expected = [2, 8, 128, 148, 164, 212, 242, 244, 256]
print('Success: test_sort')

def main():