sorting - How to sort by key AND value in SICStus Prolog? -
i have list like
l = [0-4, 0-3, 3-5, 1-2]
and sort list key , value result be
l = [0-3, 0-4, 1-2, 3-5]
i found keysort sorts key. can write sort myself need efficient solution.
call sort/2 (or msort/2 if want keep duplicates)
?- sort([0-4, 0-3, 3-5, 1-2], s). s = [0-3, 0-4, 1-2, 3-5].
Comments
Post a Comment