Пример #1
0
 def test_01_quicksort(self):
     self.arr.append(1000)
     result = quicksort_simulation(self.arr)
     self.assertEqual(result[-1], 1000)
Пример #2
0
    def test_01_quicksort_simulation(self):
        list1 = [2, 3, 5, 1, 4, 6, 7]

        self.assertEqual(quicksort_simulation(list1), [1, 2, 3, 4, 5, 6, 7])
Пример #3
0
    def test_04_quicksort_simulation(self):
        list1 = [2, 3, 5, 1, 4, 6, 7, 9, 11, 10, 8]

        self.assertEqual(quicksort_simulation(list1),
                         [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11])
Пример #4
0
    def test_05_quicksort_simulation(self):
        list1 = [2, 3, 5, 1, 4, 6, 7, 9, 11, 10, 8]
        list1 = list1 * 100
        sorted_list = quicksort_simulation(list1)

        self.assertEqual(sorted_list[-1], 11)
Пример #5
0
    def test_03_quicksort_simulation(self):
        list1 = [2]

        self.assertEqual(quicksort_simulation(list1), [2])