Search in Rotated Sorted Array

Given an array with only unique numbers, and the array was rotated at some point. Search the target in O(logn). Binary Search Using binary search, the complex part is need to check whether the middle point land on the first section or the second section. Compare middle element with target and target with num[l] and […]

Find Minimum in Rotated Sorted Array

No Duplicates Given a sorted array may rotated at some point. Find the minimum element from the array. Binary Search Solution (Recursion) Each iteration compare middle element with two ends, and decide which direction to move. (0) If left == right, we found the solution. (1) If left is less than right (include mid, cause […]