| Sorts a list.
merge_sort(+UnsortList, -SortList)
merge_sort/2 sorts the elements of UnsortList
and unifies that new list with SortList.
The order is given by the order of the terms in MINERVA.
Unlike sort/2 merge_sort/2 does not remove duplicate
elements.
Arguments
UnsortList list
SortList list
Examples
| sort([a,d,c,a],X). |
Succeeds with substitution X <- [a,a,c,d].
|
Standard
This predicate is not part of the ISO-Prolog Standard.
See also
append/3,
member/2,
reverse/2/3,
sort/2.
|