Ejemplo n.º 1
0
 def test_WithDuplicate(self):
     lst = [1, 2, 2, 1, 0, 0, 15, 15]
     sortedList = lst
     radixSort(sortedList)
     self.assertEqual(sortedList, [0, 0, 1, 1, 2, 2, 15, 15])
Ejemplo n.º 2
0
 def test_BigNumbers(self):
     lst = [135604, 1000000, 45, 78435, 456219832, 2, 546]
     sortedList = lst
     radixSort(sortedList)
     self.assertEqual(sortedList,
                      [2, 45, 546, 78435, 135604, 1000000, 456219832])
Ejemplo n.º 3
0
 def test_WithZero(self):
     lst = [10, 0]
     sortedList = lst
     radixSort(sortedList)
     self.assertEqual(sortedList, [0, 10])
Ejemplo n.º 4
0
 def test_TwoUnsorted(self):
     lst = [2, 1]
     sortedList = lst
     radixSort(sortedList)
     self.assertEqual(sortedList, [1, 2])
Ejemplo n.º 5
0
 def test_TwoSorted(self):
     lst = [1, 2]
     sortedList = lst
     radixSort(sortedList)
     self.assertEqual(lst, sortedList)
Ejemplo n.º 6
0
 def test_SingleList(self):
     lst = [1]
     sortedList = lst
     radixSort(sortedList)
     self.assertEqual(lst, sortedList)
Ejemplo n.º 7
0
 def test_EmptyList(self):
     lst = []
     sortedList = lst
     radixSort(sortedList)
     self.assertEqual(lst, sortedList)