Skip to content

Instantly share code, notes, and snippets.

@st0le
Created May 11, 2013 05:02
Show Gist options
  • Save st0le/5558958 to your computer and use it in GitHub Desktop.
Save st0le/5558958 to your computer and use it in GitHub Desktop.
Find Rotation Point
def find_rotation_binary_search(L):
left,right = 0,len(L) - 1
while L[left] > L[right]:
mid = (left + right) / 2
if L[mid] > L[right]:
left = mid + 1
else:
right = mid
return left
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment