Find an object in a sorted array in O(logn) time.
Anonymous
Binary search is the obvious answer (although its implementation is surprisingly tricky). But in C++ pretty easy: #include std::binary_search(arr.begin(), arr.end(), value);
Check out your Company Bowl for anonymous work chats.