given a sorted array of length N, that is rotated by X spots. find X.
ie. original sorted array: 1-4-10-25-39-42-55-99
rotated by 3 gives: 25-39-42-55-99-1-4-10
this was given as a microsoft intern interview question
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment