This Python script demonstrates the versatile application of binary search in various scenarios:
- The script includes a function (
mySqrt
) that utilizes binary search to find the square root of a given number.
- Another function (
find_first_last_occurrence
) employs binary search to find the first and last occurrence of a target element in a sorted array.
- A function (
search_in_2d_matrix
) applies binary search to determine whether a target value is present in a 2D matrix where each row and each column is sorted.
- The script finds the peak element in an array using binary search.
Just Python 3.6.9
TODO
This project is licensed under the MIT License - see the LICENSE.md file for details