赞
踩
- 1. low<-1; high<-n; j<-0
- 2. while(low<=high)and(j=0)
- 3. mid<-round((low+high)/2)
- 4. if x=A[mid] then j<-mid
- 5. else if x<A[mid] then high<-mid-1
- 6. else low<-mid+1
- 7. end while
- 8. return j
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。