急!!!!!!怎样用delphi实现快速排序算法???????
解决方案 »
- 字符串解析成句 用RichEdit可以实现吗?
- delphi6 调试不了
- 请教一个关有ADOQuery与sqlserver数据库的问题
- 2个DBgrid + 1个删除按钮,如何判断,在点击按钮之前焦点是在哪个DBgrid中,以便针对不同的dataset做处理.
- 本人第一次制作安装程序,先向前辈们请教!是关于用Wise9.02制作安装程序的几个问题,在次先谢谢了!
- 限制计算时间和辅助空间的数组排序算法问题!!高分赐教。
- 如何改变InputBox的字体?
- 如何在没启动workstation服务时候获得本机的工作组
- 求助:Delphi开发组织架构图(族谱的亲系图)
- DELPHI连接SQLSERVER的问题
- 设置窗体焦点
- 如何在代理的情况下建立socket连接?
procedure swap(var a,b:integer); //交换
var tmp:integer;
begin
tmp:=a;
a:=b;
b:=tmp;
end;
function partition(var SortNum:array of integer;p,r:integer):integer; //划分
var i,j,x:integer;
begin
i:=p;j:=r+1;
x:=SortNum[p];
while true do
begin
repeat inc(i)
until SortNum[i]<x;
repeat inc(j,-1)
until SortNum[j]>x;
if i>=j then break;
swap(SortNum[i],SortNum[j]);
end;
SortNum[p]:=SortNum[j];
SortNum[j]:=x;
result:=j;
end;
var q:integer;
begin
if p<r then
begin
q:=partition(SortNum,p,r);
QuickSort(SortNum,p,q-1);
QuickSort(SortNum,q+1,r);
end;
end;
type
lin_t = packed record
eqnum : string;
edescription : string;
location : string;
ldescription : string;
installdate : string;
purchaseprice : double; end;