...

/

Solution: Find Minimum in Rotated Sorted Array

Solution: Find Minimum in Rotated Sorted Array

Let's solve the Find Minimum in Rotated Sorted Array problem using the Modified Binary Search pattern.

Statement

You’re given a rotated sorted array, arr, of length nn, that is rotated clockwise between 11 and nn times.

For example,

  • Before rotation, arr =[1,2,3,4,5,6,7,8]= [1,2,3,4,5,6,7,8]

  • After 33 rotations, the array becomes [6,7,8,1,2,3,4,5][6,7,8,1,2,3,4,5].

Mathematically, we can say that if the original array was [a[0],a[1],a[2],...,a[n1]][a[0],a[1],a[2], ... ,a[n−1]], then each rotation changes the array as follows: ...