summaryrefslogtreecommitdiff
path: root/prolog/problems/sorting/pivoting_4/en.py
blob: 5a5e1717003e4dba1e36d9d0bad634adb9cc231a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# coding=utf-8

id = 124
name = 'pivoting/4'
slug = 'split a list according to the pivot'

description = '''\
<p><code>pivoting(P, L, S, G)</code>: the list <code>S</code> contains the elements of <code>L</code> <em>smaller or equal to</em> <code>P</code>, and the list <code>G</code> contains the elements of <code>L</code> <em>greater than</em> <code>P</code>. The order of elements in <code>S</code> and <code>G</code> should be the same as in <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 = {}