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

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -