寫正確程序須要注意的地方:一個數組是有一個遞減數列座椅若干位造成的,在這種數組中查找某一個數。

//4,3,2,1,10,9,8,7,6,5 int searchInRotateSortedArray(int* arr, int count, int value) { if (count<=0 || arr==NULL) return -1; int mid; int left=0; int right=count-1; while (left<=right) { //
相關文章
相關標籤/搜索