for i:= 1 to 5 do
begin
temp := data[i];
bawah := 1;
atas := i;
k:=i;
while (bawah < atas) do
begin
tengah := (bawah + atas) div 2;
if (temp <= data[tengah]) then
atas := tengah
else
bawah := tengah + 1;
end;
while (k > atas) do
begin
data[k] := data[k - 1];
data[atas] := temp;
k-=1;
end;
end;
problème est, un tableau ordonné ne sont pas tout à fait le résultat est comme ceci:Insertion binaire Tri algorithme double sortie
ok .. merci pour l'explication monsieur –
Vous êtes les bienvenus ;-) – trincot