IF Computer > MINERVA > Manual > Reference > Predicates > Lists > merge_sort/2

merge_sort/2

MINERVA
ifcomputer logo
f
Expert Services on the Web

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.

document: http://www.ifcomputer.co.jp/MINERVA/Manual/Reference/Predicates/lists/merge_sort/print_en.html
published 2012/2/6 update 2001/2/7 (c) 1996-2009 IF Computer Japan
IF Computer 5-28-2 Sendagi, Bunkyo-ku Tel +81-3-5814-3352 start (AT) ifcomputer.com
Customer Support Tokyo 113-0022 Japan   http://www.ifcomputer.com
Back> managed with ubiCMS