Difference between revisions of "BubbleSort"
From SCAR Divi Manual
(→Availability) |
|||
Line 1: | Line 1: | ||
==Definition== | ==Definition== | ||
<source lang="scar" lines="false"> | <source lang="scar" lines="false"> | ||
− | procedure BubbleSort(var Values: | + | procedure BubbleSort(var Values: TIntArray); |
</source> | </source> | ||
==Availability== | ==Availability== | ||
SCAR Divi 3.10 > Current | SCAR Divi 3.10 > Current | ||
+ | |||
+ | * '''Values''' was a [[TIntegerArray]] before SCAR Divi 3.28. | ||
==Description== | ==Description== | ||
− | Uses the [http://en.wikipedia.org/wiki/Bubble_sort bubblesort] sorting algorithm to sort a given set of [[integer]] values specified by the [[ | + | Uses the [http://en.wikipedia.org/wiki/Bubble_sort bubblesort] sorting algorithm to sort a given set of [[integer]] values specified by the [[TIntArray]] '''Values'''. The values will be sorted small->large. |
==Example== | ==Example== | ||
<source lang="scar"> | <source lang="scar"> | ||
var | var | ||
− | Values: | + | Values: TIntArray; |
i: Integer; | i: Integer; | ||
begin | begin |
Revision as of 10:20, 21 October 2011
Definition
procedure BubbleSort(var Values: TIntArray);
Availability
SCAR Divi 3.10 > Current
- Values was a TIntegerArray before SCAR Divi 3.28.
Description
Uses the bubblesort sorting algorithm to sort a given set of integer values specified by the TIntArray Values. The values will be sorted small->large.
Example
var Values: TIntArray; i: Integer; begin Values := [9, 1, 8, 2, 4]; BubbleSort(Values); for i := Low(Values) to High(Values) do WriteLn(Values[i]); end.
Output:
1 2 4 8 9