Writing a sort comparison function--Raymond Chen

How do you do it?

Writing a sort comparison function part 1, part 2, part 3, part 4

by Raymond Chen

From the article:

I’ve noted in the past that a sort comparison function must follow certain rules, and if you violate those rules, very strange things happen. So what are some patterns for writing sort comparison functions that don’t break the rules?

Most of the time, sorting can be reduced to key comparison: From each element being sorted, you generate a sort key, and those sort keys are compared against each other...

Add a Comment

Comments are closed.

Comments (0)

There are currently no comments on this entry.