codemistic / Data-Structures-and-Algorithms

A repository to help the open-source community with DSA related contributions
MIT License
345 stars 341 forks source link

Update binary_search.py #536

Closed Mohammad-Palla closed 1 year ago

Mohammad-Palla commented 1 year ago

Instead of mid = (high + low) // 2 we use mid = low + (high - low) // 2 so that integer does not go out of range for big numbers.