紧急请教!!!在线!!!!!!!!等!!!!
#include"stdio.h"
void BInsertSort(int l[],int n)
{
int low,high,temp,i,j,mid;
for(i=2;i<=n;i++){
temp=l[i];
low=1;
high=i-1;
while(low<=high){
mid=(low+high)/2;
if(temp<l[mid]) high=mid-1;
else low=mid+1;
}
for(j=i-1;j>low;j--) l[j+1]=l[j];
l[low]=temp;
}
}
void main()
{
int i;
static int l[]={2,6,8,4,5,7,9};
BInsertSort(l,7);
for(i=0;i<7;i++) printf("%d\t",l[i]);
}
看看哪里有问题?????
输出结果有问题的!
!