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

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 = {}