First part: Given a sorted array that was "shifted", e.g., [1, 2, 3, 4] ---> [2, 3, 4, 1], write an algorithm that finds the maximum value in the array. Second part: Improve the time complexity using parallel computing.
Anonymous
You can do a binary search where in step you choose the part where the first element is greater than the last element in that part. That way you can achieve log(n) time complexity.
Check out your Company Bowl for anonymous work chats.