In Binary Search Algorithm
,
in general
if mid_value > search_element we set high = mid_pos-1 ;
else mid_value < search_element we set low = mid_pos+1 ;
But I've just modified the algorithm like these
if mid_value > search_element we set high = mid_pos ;
else mid_value < search_element we set low = mid_pos ;
But my teacher told me that the standard algorithm for binary search
is the first one and what you have written is also a search algorithm but it's not an algorithm for binary search.
Is he correct?.