|WikiProject Computing||(Rated Stub-class)|
Why are you promoting such an inefficient example? What about simply returning x-y?
- Which pages did you have in mind for the disambiguation page? - Richfife (talk) 16:27, 6 January 2010 (UTC)
It doesn't make sense to sort "arbitrary objects" since they don't have a natural ordering. The actual requirement is a set of objects with a strict weak ordering, but I don't know what to cite for that. McKay (talk) 07:00, 20 January 2014 (UTC)
qsortcan sort arbitrary objects, as long as they have fixed size (or are addressed through pointers), because the ordering is entirely decoupled from the objects. It's the comparison function that must fulfill the axioms of a total ordering (C11 Standard, §7.22.5). QVVERTYVS (hm?) 13:25, 22 April 2014 (UTC)
- I'm looking at a slightly later draft but I assume this part hasn't changed. I don't think it is intended to mean what a mathematical reader will understand from the words there. In 22.214.171.124 it says "If two elements compare as equal, their order in the resulting sorted array is unspecified.", but in a total ordered set elements are only equal to themselves. Here the intention is to allow two non-identical elements to compare equal (for example the comparison function can compare a key field in each object and ignore the rest of the objects). An order which is like a total order except extra equalities are allowed is a "strict weak ordering", but I'm not suggesting we use that term that since nobody will understand it. McKay (talk) 06:33, 23 April 2014 (UTC)