This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
program Project1; | |
const | |
MAX = 20; | |
var | |
A: array[0..MAX-1] of Integer; | |
function FindLM(I: Integer): Integer; | |
var |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void duff_copy(char *to, char *from, int count) { | |
int n = (count + 7) / 8; | |
switch (count % 8) { | |
case 0: do { *to++ = *from++; | |
case 7: *to++ = *from++; | |
case 6: *to++ = *from++; | |
case 5: *to++ = *from++; | |
case 4: *to++ = *from++; | |
case 3: *to++ = *from++; | |
case 2: *to++ = *from++; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unit | |
array_of_const; | |
{$mode ObjFPC}{$H+} | |
{$modeswitch advancedrecords} | |
interface | |
uses | |
Classes, SysUtils; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List l = [12, 4, 2, 4, 55, 66, 3.14, 3, 12]; | |
void main() { | |
print('$l -> ${bubbleSort(List.from(l))}'); | |
print('$l -> ${selSort(List.from(l))}'); | |
} | |
List bubbleSort(List l) { | |
bool swap = true; | |
while (swap) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef ListInt = List<int>; | |
ListInt l = [12, 14, 2, 5, 1298, 88, 2, 12, 14, 2, 5, 1298, 88, 2]; | |
void main() { | |
fun1(l); | |
print('kesten= ${kestenSort(l)}'); | |
print('kesten2= ${kestenSort2(l)}'); | |
print('kesten3= ${kestenSort3(l)}'); | |
} |