An open API service indexing awesome lists of open source software.

https://github.com/francescopaolol/binarysearchdemo

This Python script demonstrates the versatile application of binary search in various scenarios
https://github.com/francescopaolol/binarysearchdemo

2d-matrix peak python sorted-arrays squareroot

Last synced: about 2 months ago
JSON representation

This Python script demonstrates the versatile application of binary search in various scenarios

Awesome Lists containing this project

README

        

# Binary Search Demo

This Python script demonstrates the versatile application of binary search in various scenarios:

## 1. Finding the Square Root
- The script includes a function (`mySqrt`) that utilizes binary search to find the square root of a given number.

## 2. Finding First and Last Occurrence in a Sorted Array
- Another function (`find_first_last_occurrence`) employs binary search to find the first and last occurrence of a target element in a sorted array.

## 3. Searching in a 2D Matrix
- 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.

## 4. Finding the Peak Element in an Array
- The script finds the peak element in an array using binary search.

![Python](https://img.shields.io/badge/python-3670A0?style=for-the-badge&logo=python&logoColor=ffdd54)

## Languages and Tools

python

## Requirements
```
Just Python 3.6.9
```

## Test Coverage
TODO

## License

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details


## Connect with me


francescopaololezza
francescopaololezza