Created
May 11, 2013 05:02
-
-
Save st0le/5558958 to your computer and use it in GitHub Desktop.
Find Rotation Point
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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