Search in Rotated Sorted Array

这道题也太简单了吧,可能我的方法不够简单

1 public class Solution {
2     public int search(int[] A, int target) {
3        for(int i=0;i<A.length;i++){
4             if(A[i]==target)
5                 return i;
6         }
7         return -1;
8     }
9 }

 

posted @ 2014-04-02 16:12  weilq  阅读(89)  评论(0编辑  收藏  举报