Beispiel #1
0
    def test_sort(self):
        array = [random.randint(1, 100) for _ in range(20)]

        array = radix_sort(array)

        assert array == sorted(array)
Beispiel #2
0
    def test_sort_custom_fn(self):
        array = [(random.randint(1, 100), random.randint(1, 100)) for _ in range(20)]

        array = radix_sort(array, lambda x: x[1])

        assert array == sorted(array, key=lambda x: x[1])