typedef struct
{
int data[100];
int length;
}Sqlist;
int Max(Sqlist L, int i, int j)
{
int mid, max, max1, max2;
if (i == j)
max = L.data[i];
else
{
mid = (i + j) / 2;
max1 = Max(L, i, mid);
max2 = Max(L, mid + 1, j);
max = (max1 > max2) ? max1 : max2;
}
return max;
}
二分递归查找数组最值
最新推荐文章于 2024-04-03 22:21:12 发布