Shell sort or odd-even transposition?
In my tests come Even-odd transposition sort is faster, correct?
Shell sort or odd-even transposition?
In my tests come Even-odd transposition sort is faster, correct?
In most non-trivial case it does make sense to code your own sorting algorithm, but not all cases are non-trivial. It all depends on what you know about the data being sorted. There are even cases where bubblesort is a valid choice (or maybe even optimal).
mylist.sort() in C++ with STL. And efficient too.Shell sort may be implemented with many variants of a initial gap size and its decrement in every step. The original algorithm is O(n^{3/2}), but some improvements were presented by Hilberd, Sedgewick and Ciura. So if you are asking which is better, you must always say which implementation do you use. So a single core shell sort should win on every sufficiently large dataset. On multiple cores will probably win odd-even sort, because it can use more processing units.