Пример #1
0
def srt_operations(f_code, v):
    if f_code == 1:
        res = bogo_sort.sort(v)
        return res
    elif f_code == 2:
        res = bubble_sort.sort(v)
        return res
    elif f_code == 3:
        res = cocktail_sort.sort(v)
        return res
    elif f_code == 4:
        res = comb_sort.sort(v)
        return res
    elif f_code == 5:
        res = gnome_sort.sort(v)
        return res
    elif f_code == 6:
        res = heap_sort.sort(v)
        return res
    elif f_code == 7:
        res = insertion_sort.sort(v)
        return res
    elif f_code == 8:
        res = merge_sort.sort(v)
        return res
    elif f_code == 9:
        res = quick_sort.sort(v)
        return res
    elif f_code == 10:
        res = quick_sort_in_place.sort(v, 0, len(v) - 1)
        return res
    elif f_code == 11:
        res = selection_sort.sort(v)
        return res
    elif f_code == 12:
        res = shell_sort.sort(v)
        return res
Пример #2
0
 def test_shellsort(self):
     self.output = shell_sort.sort(self.input)
     self.assertEqual(self.correct, self.output)
Пример #3
0
 def test_shellsort(self):
     self.output = shell_sort.sort(self.input)
     self.assertEqual(self.correct, self.output)