iamantony / CppNotes

My notes about C++
MIT License
1 stars 3 forks source link

Task: rotated sorted array #8

Closed iamantony closed 6 years ago

iamantony commented 8 years ago

A sorted array has been rotated so that the elements might appear int order 3 4 5 6 7 1 2. How would you find the minimum element? You may assume that the array has all unique elements.

Brute force: traverse all array. Better approach: binary search.

iamantony commented 6 years ago

Done: b04ce07b1b914946f7446796177740f2467f6802