Beispiel #1
0
 def test_pancake_sort(self):
     self.assertEqual([1, 5, 23, 57, 65, 1232],
                      pancake_sort([1, 5, 65, 23, 57, 1232]))
from algorithms.sort import pancake_sort
import random

alist = [random.randint(1, 100) for i in range(100)]
print(alist)
sorted_list = pancake_sort(alist)
print(sorted_list)
Beispiel #3
0
 def test_pancake_sort(self):
     self.assertTrue(is_sorted(pancake_sort([1, 3, 2, 5, 65, 23, 57,
                                             1232])))
Beispiel #4
0
 def test_pancake_sort(self):
     self.assertEqual([1, 5, 23, 57, 65, 1232],
                      pancake_sort([1, 5, 65, 23, 57, 1232]))