function qSort(c,l,h)
{
c=document.form1.TextResult.value;
str=""
sb=""
if(l<h)
{for(m=0;m<ss.length;m++)
{if(m==ss.length-1)
str+=ss[m];
else
str+=ss[m]+",";
}
sb+=str+"<br>";
pivot=Sort(ss,l,h);
window.sbs.innerHTML=sb;
qSort(ss,l,pivot-1);
qSort(ss,pivot+1,h);
}
}
{
c=document.form1.TextResult.value;
str=""
sb=""
if(l<h)
{for(m=0;m<ss.length;m++)
{if(m==ss.length-1)
str+=ss[m];
else
str+=ss[m]+",";
}
sb+=str+"<br>";
pivot=Sort(ss,l,h);
window.sbs.innerHTML=sb;
qSort(ss,l,pivot-1);
qSort(ss,pivot+1,h);
}
}
博客展示了一个名为qSort的函数代码,该函数接收参数c、l、h,在函数内部对输入值进行处理,使用了Sort函数确定pivot,还涉及字符串拼接等操作,最后通过递归调用自身完成排序相关逻辑。
362

被折叠的 条评论
为什么被折叠?



