https://ide.codingblocks.com/s/144417 : In Line 12 it’s apperaing but why ??
Input mismatch exception error
Hi @Mayank2096,
Your implementation of Binary search is wrong. I have pasted the correct code snippet below:
while (low <= high) {
int mid = (low + high) / 2;
if (arr[mid] == i) {
index = mid;
high = mid - 1;
} else if (arr[mid] > i)
high = mid - 1;
else
low = mid+1;
}