Binary search algorithm implementation in python


Binary search algorithm in python

In [2]:
Enter the size of the array: 5
Enter the elements of the array: 
5
10
15
20
25
Enter the search value: 25
25  found at position 5

===Time Compexity===

Best Case: O(1) Worst Case/Average Case: O(log n)

No comments:

Post a Comment