CARVIEW |
Select Language
HTTP/2 200
date: Sat, 11 Oct 2025 12:33:04 GMT
content-type: text/html; charset=UTF-8
server: cloudflare
x-frame-options: DENY
x-content-type-options: nosniff
x-xss-protection: 1;mode=block
vary: accept-encoding
cf-cache-status: DYNAMIC
content-encoding: gzip
set-cookie: _csrf-frontend=793b714c22af2a4391d6ca99281e159450b716f1edd102bb21245d86dbbb6ec1a%3A2%3A%7Bi%3A0%3Bs%3A14%3A%22_csrf-frontend%22%3Bi%3A1%3Bs%3A32%3A%22Xpz-uVwyYOYC8FpWNMFGuqI5Blo5ToYC%22%3B%7D; HttpOnly; Path=/
cf-ray: 98ce623ee8f26cd6-BLR
program new;{$I SRL/osr.simba}procedure SelectionSort1(arr: TIntegerArray) - Pastebin.com
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program new;
- {$I SRL/osr.simba}
- procedure SelectionSort1(arr: TIntegerArray);
- var
- i, j, mi, hi: Int32;
- tmp: Int32;
- begin
- hi := High(arr)
- for i:=0 to hi-1 do
- begin
- mi := i;
- for j:=i+1 to hi do
- if arr[j] < arr[mi] then
- mi := j;
- if mi <> i then
- begin
- tmp:=arr[i];
- arr[i]:=arr[mi];
- arr[mi]:=tmp;
- end;
- end;
- end;
- procedure SelectionSort2(arr: TIntegerArray);
- var
- i, j, mi, hi: Int32;
- tmp: Int32;
- begin
- hi := High(arr);
- for i:=0 to hi-1 do
- begin
- mi := i;
- j := i+1;
- while j <= hi do
- begin
- if arr[j] < arr[mi] then
- mi := j;
- j := j + 1;
- end;
- if mi <> i then
- begin
- tmp:=arr[i];
- arr[i]:=arr[mi];
- arr[mi]:=tmp;
- end;
- end;
- end;
- procedure DoTest(n: Int32);
- var
- arr, orig: TIntegerArray;
- i: Int32;
- t:Double;
- begin
- for i:=0 to n do
- Insert(Int32(Random(0,$FFFFFF)), orig, 0);
- arr := Copy(orig);
- t := PerformanceTimer();
- SelectionSort1(arr);
- WriteLn('SelectionSort1: ', PerformanceTimer() - t,'ms');
- arr := Copy(orig);
- t := PerformanceTimer();
- SelectionSort2(arr);
- WriteLn('SelectionSort2: ', PerformanceTimer() - t,'ms');
- end;
- begin
- DoTest(5000);
- end.
Advertisement
Add Comment
Please, Sign In to add comment
-
⭐✅ MAKE $2500 IN 15 MIN⭐⭐⭐ 4
JavaScript | 7 sec ago | 0.24 KB
-
⭐ G2A Bug ⭐ (Get more on BTC swaps) ✅ NEVER S...
JavaScript | 7 sec ago | 0.24 KB
-
⭐✅ Jack's Profit Method ✅ NEVER SEEN BEF...
JavaScript | 16 sec ago | 0.24 KB
-
⭐✅ Exploit 2500$ in 15 Minutes⭐⭐⭐ C
JavaScript | 18 sec ago | 0.24 KB
-
⭐✅ Online Marketplace Exploit ✅ NEVER SEEN BE...
JavaScript | 25 sec ago | 0.24 KB
-
⭐✅ Trading Profit Method ✅ NEVER SEEN BEFORE...
JavaScript | 34 sec ago | 0.24 KB
-
Free Crypto Method (NEVER SEEN BEFORE)⭐⭐ 4
JavaScript | 39 sec ago | 0.24 KB
-
⭐ Instant BTC Profit Method ✅ NEVER SEEN BEFO...
JavaScript | 43 sec ago | 0.24 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand