Пример #1
0
 def test_search_empty_array(self):
     self.assertEqual(-1, rotated_array_search([], 10))
Пример #2
0
 def test_search_in_sorted_array_two_number_10(self):
     self.assertEqual(self.linear_search(self.rarray_3, 10),
                      rotated_array_search(self.rarray_3, 10))
Пример #3
0
 def test_search_in_rotated_array_two_number_12(self):
     self.assertEqual(-1, rotated_array_search(self.rarray_2, 12))
Пример #4
0
 def test_search_in_rotated_array_two_number_1(self):
     self.assertEqual(self.linear_search(self.rarray_2, 1),
                      rotated_array_search(self.rarray_2, 1))
Пример #5
0
 def test_search_in_rotated_array_one_number_200(self):
     self.assertEqual(-1, rotated_array_search(self.rarray_1, 200))
Пример #6
0
 def test_search_in_rotated_array_one_number_2(self):
     self.assertEqual(self.linear_search(self.rarray_1, 2),
                      rotated_array_search(self.rarray_1, 2))