Closed varunvilva closed 1 year ago
I am taking the index number as the input for the function binary search. So it will not produce overflow.If in input high is taken as array length then it will cause overflow. I have also seen some codes use mid = low + (high - low) /2 are you referring to this as overflow?
Yes mid = (low + high) / 2 can cause overflow
Fixes #822
By submitting this pull request I confirm I've read and complied with the below declarations.
Added {Algorithm/DS name} [{Language}]
, notUpdate README.md
orAdded new code
.Output: