您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 项目/工程管理 > 冒泡排序快速排序流程图盒图N-S图
冒泡排序Exchange=nWhileexchange!=0Bound=exchangeExchange=0While(jbound)R[i]R[j+1]R[j]→←R[j+1]Exchange=jExchange=nDo-while(exchange!=0)Bound=exchangeExchange=0Intj=1Dowhile(jbound)J++tR[j]R[j+`]fR[j]→←R[j+1]Exchange=j↓}开始rExchange=nExchange0结束Bound=exchangeExchange=0J=1JboundNYNYr[j]r[j+1]YNr[j]与r[j+1]的值交换Exchange=jj=j+1快速排序ij开始j=end;i=firstr[i]=r[j]ijr[i]=r[j]r[i]r[j]i++;ijr[i]r[j]i++;i++j--Returni;此时让first=0;end=i-1;此时让first=i;end=n;firstend输出序列NNNYYNNNYYWhile(firstend)i=first;j=end;While(R[i]=R[j])j--TijFR[i]R[j]while(R[i]=R[j])i++i++TijFR[i]R[j]j--First=0;end=i-1;First=i;end=n;输出排完序的数组ijijiji=first;j=end;While(firstend)i++While(r[i]=r[j])R[i]R[j]i++i++While(r[i]=r[j])R[i]R[j]j--First=0;end=i-1;First=i;end=n;输出序列一元二次方程求根流程图开始输入a,b,cS=xb=0NbcxYc=0NYS=”全体实数””S=“无解”a=0输出SS=”x1”+”x2”△<0YN△←b2-4acabxabx2,221S=“无实根”Y
本文标题:冒泡排序快速排序流程图盒图N-S图
链接地址:https://www.777doc.com/doc-3578018 .html