gitweb on Svarog
projekti pod git sistemom za održavanje verzija -- projects under the git version control system
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 611ac74)
raw | patch | inline | side by side (parent: 611ac74)
author | Doni Pracner <quinnuendo@gmail.com> | |
Wed, 30 Oct 2013 14:26:24 +0000 (15:26 +0100) | ||
committer | Doni Pracner <quinnuendo@gmail.com> | |
Wed, 30 Oct 2013 14:26:24 +0000 (15:26 +0100) |
03. Shaker sort/Prezentacija.ppt | [new file with mode: 0644] | patch | blob |
03. Shaker sort/kod/SHAKER.MOD | [new file with mode: 0644] | patch | blob |
Cas03/Prezentacija.ppt | [deleted file] | patch | blob | history |
Cas03/SHAKER.MOD | [deleted file] | patch | blob | history |
diff --git a/03. Shaker sort/Prezentacija.ppt b/03. Shaker sort/Prezentacija.ppt
new file mode 100644 (file)
index 0000000..d059c40
Binary files /dev/null and b/03. Shaker sort/Prezentacija.ppt differ
index 0000000..d059c40
Binary files /dev/null and b/03. Shaker sort/Prezentacija.ppt differ
diff --git a/03. Shaker sort/kod/SHAKER.MOD b/03. Shaker sort/kod/SHAKER.MOD
--- /dev/null
@@ -0,0 +1,80 @@
+MODULE Shaker;\r
+\r
+ FROM IO IMPORT\r
+ WrCard, WrStr, RdCard, WrLn, OK;\r
+\r
+ CONST\r
+ Max = 10;\r
+\r
+ TYPE\r
+ Indeks = [1 .. Max];\r
+ NizTip = ARRAY Indeks OF CARDINAL;\r
+\r
+ VAR\r
+ Niz: NizTip;\r
+\r
+ PROCEDURE Unos(VAR Niz: NizTip);\r
+ VAR\r
+ i: Indeks;\r
+ BEGIN\r
+ FOR i:= 1 TO Max DO\r
+ REPEAT\r
+ WrStr('Unesite ');\r
+ WrCard(i, 2);\r
+ WrStr('. clan niza: ');\r
+ Niz[i]:= RdCard();\r
+ WrLn;\r
+ UNTIL OK;\r
+ END;\r
+ END Unos;\r
+\r
+ PROCEDURE Ispis(VAR Niz: NizTip);\r
+ VAR\r
+ i: Indeks;\r
+ BEGIN\r
+ FOR i := 1 TO Max - 1 DO\r
+ WrCard(Niz[i], 1);\r
+ WrStr(', ');\r
+ END;\r
+ WrCard(Niz[Max], 1);\r
+ END Ispis;\r
+\r
+ PROCEDURE ShakerSort(VAR Niz: NizTip);\r
+ VAR\r
+ Levi, Desni, i, ZadnjiMenjan: Indeks;\r
+ Temp: CARDINAL;\r
+ BEGIN\r
+ Levi:= 2;\r
+ Desni:= Max;\r
+ ZadnjiMenjan:= Max;\r
+ REPEAT\r
+ FOR i:= Desni TO Levi BY -1 DO\r
+ IF Niz[i - 1] > Niz[i] THEN\r
+ Temp:= Niz[i - 1];\r
+ Niz[i - 1]:= Niz[i];\r
+ Niz[i]:= Temp;\r
+ ZadnjiMenjan:= i;\r
+ END;\r
+ END;\r
+ Levi:= ZadnjiMenjan + 1;\r
+ FOR i:= Levi TO Desni DO\r
+ IF Niz[i - 1] > Niz[i] THEN\r
+ Temp:= Niz[i - 1];\r
+ Niz[i - 1]:= Niz[i];\r
+ Niz[i]:= Temp;\r
+ ZadnjiMenjan:= i;\r
+ END;\r
+ END;\r
+ Desni:= ZadnjiMenjan - 1;\r
+ UNTIL Levi > Desni;\r
+ END ShakerSort;\r
+\r
+BEGIN\r
+ Unos(Niz);\r
+ WrStr('Unesen niz: ');\r
+ Ispis(Niz);\r
+ WrLn;\r
+ WrStr('Sortiran niz: ');\r
+ ShakerSort(Niz);\r
+ Ispis(Niz);\r
+END Shaker.\r
diff --git a/Cas03/Prezentacija.ppt b/Cas03/Prezentacija.ppt
deleted file mode 100644 (file)
index d059c40..0000000
Binary files a/Cas03/Prezentacija.ppt and /dev/null differ
index d059c40..0000000
Binary files a/Cas03/Prezentacija.ppt and /dev/null differ
diff --git a/Cas03/SHAKER.MOD b/Cas03/SHAKER.MOD
--- a/Cas03/SHAKER.MOD
+++ /dev/null
@@ -1,80 +0,0 @@
-MODULE Shaker;\r
-\r
- FROM IO IMPORT\r
- WrCard, WrStr, RdCard, WrLn, OK;\r
-\r
- CONST\r
- Max = 10;\r
-\r
- TYPE\r
- Indeks = [1 .. Max];\r
- NizTip = ARRAY Indeks OF CARDINAL;\r
-\r
- VAR\r
- Niz: NizTip;\r
-\r
- PROCEDURE Unos(VAR Niz: NizTip);\r
- VAR\r
- i: Indeks;\r
- BEGIN\r
- FOR i:= 1 TO Max DO\r
- REPEAT\r
- WrStr('Unesite ');\r
- WrCard(i, 2);\r
- WrStr('. clan niza: ');\r
- Niz[i]:= RdCard();\r
- WrLn;\r
- UNTIL OK;\r
- END;\r
- END Unos;\r
-\r
- PROCEDURE Ispis(VAR Niz: NizTip);\r
- VAR\r
- i: Indeks;\r
- BEGIN\r
- FOR i := 1 TO Max - 1 DO\r
- WrCard(Niz[i], 1);\r
- WrStr(', ');\r
- END;\r
- WrCard(Niz[Max], 1);\r
- END Ispis;\r
-\r
- PROCEDURE ShakerSort(VAR Niz: NizTip);\r
- VAR\r
- Levi, Desni, i, ZadnjiMenjan: Indeks;\r
- Temp: CARDINAL;\r
- BEGIN\r
- Levi:= 2;\r
- Desni:= Max;\r
- ZadnjiMenjan:= Max;\r
- REPEAT\r
- FOR i:= Desni TO Levi BY -1 DO\r
- IF Niz[i - 1] > Niz[i] THEN\r
- Temp:= Niz[i - 1];\r
- Niz[i - 1]:= Niz[i];\r
- Niz[i]:= Temp;\r
- ZadnjiMenjan:= i;\r
- END;\r
- END;\r
- Levi:= ZadnjiMenjan + 1;\r
- FOR i:= Levi TO Desni DO\r
- IF Niz[i - 1] > Niz[i] THEN\r
- Temp:= Niz[i - 1];\r
- Niz[i - 1]:= Niz[i];\r
- Niz[i]:= Temp;\r
- ZadnjiMenjan:= i;\r
- END;\r
- END;\r
- Desni:= ZadnjiMenjan - 1;\r
- UNTIL Levi > Desni;\r
- END ShakerSort;\r
-\r
-BEGIN\r
- Unos(Niz);\r
- WrStr('Unesen niz: ');\r
- Ispis(Niz);\r
- WrLn;\r
- WrStr('Sortiran niz: ');\r
- ShakerSort(Niz);\r
- Ispis(Niz);\r
-END Shaker.\r