In STL QUIZ Given
int [] s= { 1,1 2,2 ,3 , 3 ,4,4 ,5,5 20 };
cout<<binary_search(s.begin(),s.end(),20)
here ans should be
1 is printed and Time complexity is logarithmic to size of array
but its given linear to size of array .
Is this correct , if so how ? Kindly help