This pull request introduces a Python implementation of the binary search algorithm. The function binary_search takes a sorted list and a target value as input and returns the index of the target value in the list. If the target value is not found, the function returns None.
Summary
Added a new file binary_search.py which contains the binary_search function.
The binary_search function uses a while loop to perform the binary search.
The function takes two arguments: a sorted list and a target value.
The function returns the index of the target value if it is found in the list, otherwise it returns None.
Included some test cases in the __main__ section of the script to demonstrate the functionality of the binary_search function.
Fixes #26.
🎉 Latest improvements to Mi6:
#
💡 To get Mi6 to edit this pull request, you can:
Comment below, and MI6 can edit the entire PR
Comment on a file, Mi6 will only modify the commented file
Edit the original issue to get Mi6 to recreate the PR from scratch
Description
This pull request introduces a Python implementation of the binary search algorithm. The function
binary_search
takes a sorted list and a target value as input and returns the index of the target value in the list. If the target value is not found, the function returnsNone
.Summary
binary_search.py
which contains thebinary_search
function.binary_search
function uses a while loop to perform the binary search.None
.__main__
section of the script to demonstrate the functionality of thebinary_search
function.Fixes #26.
🎉 Latest improvements to Mi6:
#💡 To get Mi6 to edit this pull request, you can: