Browse thread
Re: [Caml-list] Sorting
- Krishnaswami, Neel
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Krishnaswami, Neel <neelk@c...> |
| Subject: | Re: [Caml-list] Sorting |
Marcin 'Qrczak' Kowalczyk [mailto:qrczak@knm.org.pl] wrote: > > What are advantages and disadvantages in parametrizing either by '<' > or by the 3-way comparison? If comparisons are very expensive -- for instance, if the elements are long strings or large sets -- then it makes for faster execution to use a three-way comparison. On the average you will do two-thirds as many comparisons while sorting with a three-way comparison. I find this irritating becuase it just *feels* nicer to pass a function of type elt -> elt -> bool to a sorting function. It's closer to how sorting is taught, and hence to my mental model. :) -- Neel Krishnaswami neelk@cswcasa.com ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr