标签:key ret lse class [] div 应该 turn style
int binary(int nums[], int l, int r, int key){ while(l<r){ int mid=l + (r-l)/2; if(nums[mid]<key) l = mid+1; else r = mid; } return l }
mid=(l+r)/2可能会出错, 应该用mid=l+(r-l)/2;
标签:key ret lse class [] div 应该 turn style
原文地址:https://www.cnblogs.com/mr-stn/p/9221103.html