I know Binary search works on sorted arrays as it is possible to access the middle element in unit time, due to array indexing. But in lists it would take linear time to access the middle element, making binary search pointless. Vectors have flexible size like lists so if they're implemented using lists,binary search shouldn't work on them right? Or do vectors use arrays with dynamic memory allocation and will binary search work in that case? (I'm a beginner so please point out any flaws in my logic)