![](https://lstatic.shangxueba.com/jiandati/pc/images/pc_jdt_tittleico.png)
快速排序算法递归实现,完成int Partition(int R[],int low,int high); //对R[low]..R[high]进行一趟划分,划分算法采用mooc教学视频中的划分策略。
![](https://lstatic.shangxueba.com/jiandati/pc/images/jdt_panel_vip.png)
![](https://lstatic.shangxueba.com/jiandati/pc/images/no_answer.png)
(1)设L=(28,19,27,49,56,12,10,25,20,50),写出f33(L,4)的返回值;
(2)简述函数f33的功能。
int Partition(SeqList*L,int low,int high);
//对L[low…high]做划分,返回基准记录的位置,并使左部的关键字
//都小于或等于基准记录的关键字,右部的关键字都大于基准记录的关键字
int f33(SeqList L,int k){
int low,high,pivotpos;
low=1;
high=L.length;
if(k<low||k>high)
return-1;
do {
pivotpos=Partition(&L,low,high);//调用快速排序的划分算法
if(pivotpos<k)
low=pivotpos+1;
else if(pivotpos>k)
high=pivotpos-1;
}while(pivotpos!=k);
return L.data[pivotpos];
}
The problem of municipal sewage disposal is complicated by the fact that, years ago, most cities combined their storm and waste disposal sewers. Many of these combined systems work well, but others cannot cope with sudden heavy rains. When such storms occur, water mixed with sewage may flood and disable treatment plants unless bypassed, untreated, into a stream. In either case, the people may have little protection for several days from these wastes that may contain disease germs.
One consequence of pollution, usually resulting from the discharge of either raw or treated sewage wastes into water sources, is an increase in nutrient levels in these waters. These higher nutrient levels result in a rapid increase in the biological population of the water. Excessive respiration and decomposition of aquatic plants deplete the oxygen content in these waters causing decay which, in turn, may produce an undesirable taste, odor, color and turbidity. Increasing nutrient contents may also result in an in- crease in more undesirable species of aquatic life. All these factors make the water un- fit for domestic, industrial and recreational purposes.
A、6789abc
B、6789abcd
C、defg12345
D、defg123456
如图所示,该二叉树的先序遍历结果是( )
A、A,B,C,D,H,E,I,F,G
B、A,B,D,H,I,E,C,F,G
C、H,D,I,B,E,A,F,C,G
D、H,I,D,B,E,F,G,A,C
为了保护您的账号安全,请在“简答题”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!