I have the code for quicksorting an array of pointers (if helps anyone) but how I do that for a doble linked list of pointers ?
procedure TSuperList.Sort;
begin
if Assigned(FOnCompare) and (Length(Items)>1) then
QuickSort(0,High(Items));
end;
procedure TSuperList.QuickSort(L,R:Integer);
var I,J: Integer;
P,T: Pointer;
begin
repeat
I:=L;
J:=R;
P:=Items[(L+R) shr 1];
repeat
while FOnCompare(self,Items[I],P) < 0 do Inc(I);
while FOnCompare(self,Items[J],P) > 0 do Dec(J);
if I <= J then begin
if I <> J then begin
T:=Items[I]; Items[I]:=Items[J]; Items[J]:=T;
end;
Inc(I);
Dec(J);
end;
until I > J;
if L < J then QuickSort(L,J);
L:=I;
until I >= R;
end;