all tasks
This commit is contained in:
parent
b83f433714
commit
68f8f3e56b
14735 changed files with 178959 additions and 0 deletions
|
|
@ -0,0 +1,18 @@
|
|||
const proc: bubbleSort (inout array elemType: arr) is func
|
||||
local
|
||||
var boolean: swapped is FALSE;
|
||||
var integer: i is 0;
|
||||
var elemType: help is elemType.value;
|
||||
begin
|
||||
repeat
|
||||
swapped := FALSE;
|
||||
for i range 1 to length(arr) - 1 do
|
||||
if arr[i] > arr[i + 1] then
|
||||
help := arr[i];
|
||||
arr[i] := arr[i + 1];
|
||||
arr[i + 1] := help;
|
||||
swapped := TRUE;
|
||||
end if;
|
||||
end for;
|
||||
until not swapped;
|
||||
end func;
|
||||
Loading…
Add table
Add a link
Reference in a new issue