Binary search has logarithmic time complexity or not

In this mcq given in algorithms STL module,
Choose the correct output and time complexity for the following code :

list< int > myList = { 2, 6, 12, 13, 15, 18, 20};
cout << binary_search(myList.begin(), myList.end(), 20) ;

answer should logarithmic time complexity, it is mentioned linear,

the answer will be 1(it’ll return bool value) with o(n) complexity only as it’s a linked list so it will take o(n) time to iterate over elements. Hope this would help :slight_smile: