Difference between revisions of "BubbleSortB"
From SCAR Divi Manual
(Created page with "==Definition== <source lang="scar" lines="false"> procedure BubbleSortB(var Values: TIntegerArray); </source> ==Availability== SCAR Divi 3.11 > Current ==Description== Uses the...") |
|||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
==Definition== | ==Definition== | ||
<source lang="scar" lines="false"> | <source lang="scar" lines="false"> | ||
− | procedure BubbleSortB(var Values: | + | procedure BubbleSortB(var Values: TIntArray); |
</source> | </source> | ||
==Availability== | ==Availability== | ||
− | SCAR Divi 3.11 > | + | SCAR Divi 3.11 > 3.37 <span style="color:#FF0000">(Deprecated, use [[SortTIA]] and [[ReverseTIA]])</span> |
+ | |||
+ | * '''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 large->small. |
==Example== | ==Example== | ||
<source lang="scar"> | <source lang="scar"> | ||
var | var | ||
− | Values: | + | Values: TIntArray; |
i: Integer; | i: Integer; | ||
begin | begin | ||
Values := [9, 1, 8, 2, 4]; | Values := [9, 1, 8, 2, 4]; | ||
− | + | BubbleSortB(Values); | |
for i := Low(Values) to High(Values) do | for i := Low(Values) to High(Values) do | ||
WriteLn(Values[i]); | WriteLn(Values[i]); | ||
Line 24: | Line 26: | ||
Output: | Output: | ||
+ | 9 | ||
+ | 8 | ||
+ | 4 | ||
+ | 2 | ||
1 | 1 | ||
− | |||
− | |||
− | |||
− | |||
==See Also== | ==See Also== | ||
− | *[[ | + | *[[BubbleSort]] |
*[[QuickSort]] | *[[QuickSort]] | ||
− | [[Category: | + | [[Category:Deprecated Functions]] |
− |
Latest revision as of 19:33, 10 December 2012
Definition
procedure BubbleSortB(var Values: TIntArray);
Availability
SCAR Divi 3.11 > 3.37 (Deprecated, use SortTIA and ReverseTIA)
- 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 large->small.
Example
var Values: TIntArray; i: Integer; begin Values := [9, 1, 8, 2, 4]; BubbleSortB(Values); for i := Low(Values) to High(Values) do WriteLn(Values[i]); end.
Output:
9 8 4 2 1