Esempio n. 1
0
 def test_bsearch_doStuff_8(self):
     a = [11, 1, 1, 2, 3, 5, 8, 13, 21, 33, 54, 87]
     b = [11, 1, 3, 4, 5, 1, 7, 8, 9, 10, 11, 87]
     expected_result = [0, 3, -1, 4, 0, -1, 5, -1, -1, -1, 10]
     self.assertEqual(binary_search.doStuff(a, b), expected_result)
Esempio n. 2
0
 def test_bsearch_doStuff_6(self):
     a = [10, 1, 1, 2, 3, 5, 8, 13, 21, 33, 54, 87]
     b = [10, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 90]
     expected_result = [2, 3, -1, 4, -1, -1, 5, -1, -1, -1, -1]
     self.assertEqual(binary_search.doStuff(a, b), expected_result)
Esempio n. 3
0
 def test_bsearch_doStuff_4(self):
     a = [6, 4, 4, 4, 4, 4, 4]
     b = [6, 5, 6, 7, 8, 8, 9]
     expected_result = [-1, -1, -1, -1, -1, -1]
     self.assertEqual(binary_search.doStuff(a, b), expected_result)
Esempio n. 4
0
 def test_bsearch_doStuff_3(self):
     a = [6, 4, 4, 4, 4, 4, 4]
     b = [6, 4, 4, 4, 4, 4, 4]
     expected_result = [2, 2, 2, 2, 2, 2]
     self.assertEqual(binary_search.doStuff(a, b), expected_result)
Esempio n. 5
0
 def test_bsearch_doStuff_2(self):
     a = [1, 4]
     b = [1, 4]
     expected_result = [0]
     self.assertEqual(binary_search.doStuff(a, b), expected_result)
Esempio n. 6
0
 def test_bsearch_doStuff_1(self):
     a = [5, 1, 5, 8, 12, 13]
     b = [5, 8, 1, 23, 1, 11]
     expected_result = [2, 0, -1, 0, -1]
     self.assertEqual(binary_search.doStuff(a, b), expected_result)