Isnt time complexity of binary search o(log n)?

in the quiz it is given linear order. so does a inbuilt binary function work differently than the normal binary function we write?

Q2. Algorithms STL#2
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) ;
Output is 20 and time complexity is Linear in size of the list.

Output is 1 and time complexity is Linear in size of the list.

Output is 20 and time complexity is Logarithmic in size of the list.

Output is 1 and time complexity is Logarithmic in size of the list.

Hey @ashishxmathew
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.