2 question of this topic

binary_search is based on divide and conquer whose complecity isO(logn).Than why the answer is 2nd option instead of 4th option

also explain 4th question,how can we tell it will return 0 or 1 without knowing the order of item 1,item2.Please also explain question 6

Binary search for a list in STL(which is a linked list) will work in O(n) and not in O(log n). Because in case of linked list, you have to traverse the linked list to reach the middle node. So unlike arrays, the middle node cannot be found O(1).

In q4, bool and 1, is the answer because return type of comp function is bool and for ascending values, item 1 should be less than item 2, (assuming that item1 occurs before item2) this is why item1 < item2 returns true.

Please explain ques 6 also

The data type must hold a string, an integer, a double and a pointer to an integer. So clearly the answer can be the first option.