MaksNew

Untitled

Dec 14th, 2020
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 0.33 KB | None | 0 0
  1. Procedure InsertSort (var Mas:array of integer; Size: integer);
  2. Var
  3.     Temp, J, I : integer;
  4. Begin
  5.     For I: = 1 to Size-1 do
  6.     Begin
  7.         If Mas[I-1] > Mas[I] then
  8.         Begin
  9.             J := I;
  10.             Temp := Mas[I];
  11.             While (J > 0 and temp < Mas[J-1] do
  12.             Begin
  13.                 Mas[J] = Mas[J-1];
  14.                 Dec[J];
  15.             End
  16.             Mas[J] := Temp
  17.         End
  18.     End
  19. End
  20.  
Add Comment
Please, Sign In to add comment