摘要:
算法思想:先相邻两个两个比较,较大的放入数组max[],较小的放入数组min[],然后从max[]数组求出最大,min[]数组求出最小即可。比较n+[(n+1)/2] =1.5n次1#include<iostream>2#definen113#definem((n+1)/2)4usingnamespacestd;56voidmain(void)7{8intnum[]={11,2,3,4,6,5,7,8,9,10,20};9//intn=sizeof(num)/sizeof(num[0]);10//intm=(n+1)/2;11intmax[m],min[m];12intk=0,j= 阅读全文