KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Most sort algorithms rely on a pairwise-comparison the determines whether A < B, A = B or A > B. I'm looking for algorithms (and for bonus points, code in Python) that take advantage of a pairwise-comparison function that can distinguish a lot less from a little less or a lot more from a little more. So perhaps instead of returning {-1, 0, 1} the comparison function returns {-2, -1, 0, 1, 2} or {-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5} or even a real number on the interval (-1, 1). For some applications (such as near sorting or approximate sorting) this would enable a reasonable sort to be determined with less comparisons.
Tags (comma-separated)
Save Edits
Cancel