Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Procedure InsertSort (var Mas:array of integer; Size: integer);
- Var
- Temp, J, I : integer;
- Begin
- For I: = 1 to Size-1 do
- Begin
- If Mas[I-1] > Mas[I] then
- Begin
- J := I;
- Temp := Mas[I];
- While (J > 0 and temp < Mas[J-1] do
- Begin
- Mas[J] = Mas[J-1];
- Dec[J];
- End
- Mas[J] := Temp
- End
- End
- End
Add Comment
Please, Sign In to add comment