How to implement a sort which makes fewest number of comparisons ? Fewest here means actual minimum, not asymptotic minimum.

Revision en1, by prac64, 2019-02-19 15:55:54

For a personal project I'm working on, I need to sort a list by asking user preferences. Naturally the list can't be too long, at most 20 values. Now since complexity is not an issue, I'm focussing on reducing the number of questions asked. My initial idea was to use library sort and overload the custom comparator which then takes user input. But it seems to me that it's asking too many questions. I've also used a memoizing table, which returns answer for (x,y) if (x,y) or (y,x) has been answered by user before, but it's still unsatisfactory.

Help me design a sort which asks for minimum comparisons. Complexity of computation is not much of an issue, go wild.

Tags sorting, application, mathematics

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English prac64 2019-02-19 15:55:54 793 Initial revision (published)