diff options
author | Aleksander Sadikov <aleksander.sadikov@fri.uni-lj.si> | 2015-12-14 13:57:29 +0100 |
---|---|---|
committer | Aleksander Sadikov <aleksander.sadikov@fri.uni-lj.si> | 2015-12-14 15:25:36 +0100 |
commit | 384d3c501a38b489312496b0bf9522bdf29053d8 (patch) | |
tree | bd1a81ce29449ee7f8d017b86365fda710afaf96 /prolog/problems/sorting | |
parent | 4918cebf5f135993cd1d2d61bc906559e627f526 (diff) |
Add Slovenian translations for Prolog exercises
Diffstat (limited to 'prolog/problems/sorting')
-rw-r--r-- | prolog/problems/sorting/is_sorted_1/sl.py | 15 | ||||
-rw-r--r-- | prolog/problems/sorting/isort_2/sl.py | 13 | ||||
-rw-r--r-- | prolog/problems/sorting/pivoting_4/sl.py | 13 | ||||
-rw-r--r-- | prolog/problems/sorting/quick_sort_2/sl.py | 13 | ||||
-rw-r--r-- | prolog/problems/sorting/sins_3/sl.py | 15 | ||||
-rw-r--r-- | prolog/problems/sorting/slowest_sort_ever_2/sl.py | 13 |
6 files changed, 82 insertions, 0 deletions
diff --git a/prolog/problems/sorting/is_sorted_1/sl.py b/prolog/problems/sorting/is_sorted_1/sl.py new file mode 100644 index 0000000..5d4c1c5 --- /dev/null +++ b/prolog/problems/sorting/is_sorted_1/sl.py @@ -0,0 +1,15 @@ +# coding=utf-8 + +name = 'is_sorted/1' +slug = 'Preveri, če so elementi seznama naraščajoče urejeni' + +description = '''\ +<p><code>is_sorted(L)</code>: elementi v seznamu <code>L</code> morajo biti urejeni v naraščajočem vrstnem redu.</p> +<pre> + ?- is_sorted([2,3,6,8,12]). + true. + ?- is_sorted([2,3,1,6,5]). + false. +</pre>''' + +hint = {} diff --git a/prolog/problems/sorting/isort_2/sl.py b/prolog/problems/sorting/isort_2/sl.py new file mode 100644 index 0000000..79c3239 --- /dev/null +++ b/prolog/problems/sorting/isort_2/sl.py @@ -0,0 +1,13 @@ +# coding=utf-8 + +name = 'isort/2' +slug = 'Uredi seznam z uporabo urejanja z vstavljanjem' + +description = '''\ +<p><code>isort(L, SL)</code>: seznam <code>SL</code> vsebuje elemente iz seznama <code>L</code> urejene v naraščajočem vrstnem redu. Uporabi predikat <code>sins/3</code> za implementacijo urejanja z vstavljanjem.</p> +<pre> + ?- isort([2,3,1,5,4], L). + L = [1,2,3,4,5]. +</pre>''' + +hint = {} diff --git a/prolog/problems/sorting/pivoting_4/sl.py b/prolog/problems/sorting/pivoting_4/sl.py new file mode 100644 index 0000000..b18e112 --- /dev/null +++ b/prolog/problems/sorting/pivoting_4/sl.py @@ -0,0 +1,13 @@ +# coding=utf-8 + +name = 'pivoting/4' +slug = 'Razdeli seznam na dva dela glede na podani element (pivot)' + +description = '''\ +<p><code>pivoting(P, L, S, G)</code>: seznam <code>S</code> vsebuje elemente iz <code>L</code> <em>manjše ali enake</em> <code>P</code>, seznam <code>G</code> pa elemente iz <code>L</code> <em>večje od</em> <code>P</code>. Vrstni red elementov v <code>S</code> in <code>G</code> naj bo enak kot v <code>L</code>.</p> +<pre> + ?- pivoting(4, [1,4,5,8,6,4,2], S, G). + S = [1,4,4,2], G = [5,8,6]. +</pre>''' + +hint = {} diff --git a/prolog/problems/sorting/quick_sort_2/sl.py b/prolog/problems/sorting/quick_sort_2/sl.py new file mode 100644 index 0000000..9611b46 --- /dev/null +++ b/prolog/problems/sorting/quick_sort_2/sl.py @@ -0,0 +1,13 @@ +# coding=utf-8 + +name = 'quick_sort/2' +slug = 'Uredi seznam z algoritmom quicksort' + +description = '''\ +<p><code>quick_sort(L, SL)</code>: seznam <code>SL</code> vsebuje elemente iz <code>L</code> urejene v naraščajočem vrstnem redu. Uporabi predikat <code>pivoting/4</code> za implementacijo algoritma quicksort.</p> +<pre> + ?- quick_sort([2,3,1,5,4], L). + L = [1,2,3,4,5]. +</pre>''' + +hint = {} diff --git a/prolog/problems/sorting/sins_3/sl.py b/prolog/problems/sorting/sins_3/sl.py new file mode 100644 index 0000000..22e51b2 --- /dev/null +++ b/prolog/problems/sorting/sins_3/sl.py @@ -0,0 +1,15 @@ +# coding=utf-8 + +name = 'sins/3' +slug = 'Vstavi element na ustrezno mesto v urejen seznam' + +description = '''\ +<p><code>sins(X, SortedList, NewList)</code>: seznam <code>NewList</code> dobiš tako, da vstaviš element <code>X</code> v <code>SortedList</code> na ustrezno mesto tako, da ohraniš urejenost elementov.</p> +<pre> + ?- sins(4, [1,2,3,5], L). + L = [1,2,3,4,5]. + ?- sins(3, [1,2,3,4], L). + L = [1,2,3,3,4]. +</pre>''' + +hint = {} diff --git a/prolog/problems/sorting/slowest_sort_ever_2/sl.py b/prolog/problems/sorting/slowest_sort_ever_2/sl.py new file mode 100644 index 0000000..c62582c --- /dev/null +++ b/prolog/problems/sorting/slowest_sort_ever_2/sl.py @@ -0,0 +1,13 @@ +# coding=utf-8 + +name = 'slowest_sort_ever/2' +slug = 'Uredi seznam elementov s pomočjo naključnih permutacij' + +description = '''\ +<p><code>slowest_sort_ever(L, SL)</code>: seznam <code>SL</code> vsebuje elemente seznama <code>L</code> v naraščajočem vrstnem redu. Časovna zahtevnost algoritma naj bo O(n * n!).</p> +<pre> + ?- slowest_sort_ever([2,3,1,5,4], L). + L = [1,2,3,4,5]. +</pre>''' + +hint = {} |