I've difficulty in understanding when to use:
while (left < right ) {
}
vs when to use:
while (left <= right ) {
}
Also while setting left and right boundaries sometimes we use:
left = mid
and sometime we use
left = mid + 1;
similarly
right = mid; vs
right = mid - 1;
Is there any fundamental I am missing in knowledge of Binary search ?