Sunday, March 31, 2013 No. 47 - Search in a Rotation of an Array Question: When some elements at the beginning of an array are moved to the end, it gets a rotation of the original array. Please implement a function to search a number in a rotation of an increasingly sorted array. Assume there are no duplicated numbers in the array. For example, array {3, 4, 5, 1, 2} is a rotation of array {1, 2, 3, 4, 5}. If the target number to be searched is 4, the index of the number 4 in the rotation 1 should be returned. If the target number to be searched is 6,
Read full article from Coding Interview Questions: No. 47 - Search in a Rotation of an Array
No comments:
Post a Comment