Thank you all for your answers. Unfortunately, I cannot use a keysort as suggested > However, I want to stress that the Eclipse sorting builtins (sort/2,4, > msort, keysort, etc) are significantly faster and it is often preferable > to use a pattern like my_sort(Random, Sorted) :- because users are allowed to provide arbitrary comparators that work on pairs of objects. I will use the merge sort suggested by Joachim, but with the predicate halve/3 supplied with list library of ECLiPSe. In general, I prefer using libraries over writing my own code - and I think that I wrote enough sorting algorithms in my student years ;-) > Versions using other sorting algorithms (merge sort, bubble sort etc.) > are an exercise for the reader ;) Yours, Ulrich -- Ulrich Scholz Personal Memory Group European Media Laboratory GmbHReceived on Mon Oct 30 2006 - 09:41:45 CET
This archive was generated by hypermail 2.3.0 : Wed Sep 25 2024 - 15:13:20 CEST