dreamer
Member
Ответ: Turbo Pascal
Код:
function bubleSort(
var data:array of any_number;
first:word;
last:word;
ordered:compFunc
);
var change:boolean;
index:word;
begin
repeat
change := false;
for index := first+1 to last
do if not ordered(data[index-1],data[index])
then begin
swap(data,index-1,index);
change := true;
end;
until not change;
end;