I have a vector of values with the minimum, but which is non-decreasing after it and non-increasing before. Here is the example:
std::vector<int> arr = {90, 80, 70, 60, 55, 62, 71, 89, 104}
In the example I want to find 55. I want to be able to find its minimum efficiently. O(n) complexity is not enough. Supposedely, it is possible to some sort of modify binary search, but I would like to know whether there are existing solutions.