MCPcopy Create free account
hub / github.com/geekcomputers/Python / Binary_Search

Function Binary_Search

Sorting Algorithms/Binary_Insertion_Sort.py:1–11  ·  view source on GitHub ↗
(Test_arr, low, high, k)

Source from the content-addressed store, hash-verified

1def Binary_Search(Test_arr, low, high, k):
2 if high >= low:
3 Mid = (low + high) // 2
4 if Test_arr[Mid] < k:
5 return Binary_Search(Test_arr, Mid + 1, high, k)
6 elif Test_arr[Mid] > k:
7 return Binary_Search(Test_arr, low, Mid - 1, k)
8 else:
9 return Mid
10 else:
11 return low
12
13
14def Insertion_Sort(Test_arr):

Callers 1

Insertion_SortFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected