U
user923005
well, this is likely difficult here (at least if the input structure is not
naturally based around linked lists or similar...). a major potential source
of overhead is likely to be in maintaining and updating the tree structure.
sadly, off hand I don't really know of any tree-sort implementations worth
much consideration for benchmarking (never really been that much into
fine-grained comparative algo benchmarking...).
I have just finished analyzing treesort. It is just heapsort, but
with an explicit (allocated as you go) rather than an implicit heap.
For that reason, it will never perform as well as heapsort. (Though it
will perform identically except with a larger constant of
proportionality due to the memory allocations).
I suggest we could rephrase your suggestion as one for using heapsort,
which is a pretty good decision for all sorts of sorting situations.
Heapsort's best claim to fame is "it never sucks." It may
underperform 'on average' compared to better sorts, but it is simple
to code and never goes quadratic.