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

id = 122
name = 'sins/3'
slug = 'insert an element at correct position into a sorted list'

description = '''\
<p><code>sins(X, SortedList, NewList)</code>: the list <code>NewList</code> is obtained by inserting <code>X</code> into <code>SortedList</code> at the correct position to preserve the non-decreasing order of elements.</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 = {}