cpp-sort icon indicating copy to clipboard operation
cpp-sort copied to clipboard

Shell sort and comb sort

Open Morwenn opened this issue 9 years ago • 0 comments

Shell sort and comb sort are common sorting algorithms that have in common the fact that their complexity depends on a series of integer values that can either be generated by a formula or given by hand. Comb sort generally takes a single ratio used to compute the successive gaps. These algorithms could be interesting additions to the library but - as usual - open a new can of worms:

  • We could give fixed versions for everyone, but this library is all about genericity and I would very much like the gap to be configurable.
  • Can the series of integers be passed as a series a integer template parameters? Can we use std::index_sequence instead?
  • Should we instead pass some kind of factory function like we do with dynamic_buffer?
  • Should comb sort and shell sort have a different interface? To be honest, I woud ike them to have the same interface, but which one?

Anyway, the bufferef sorters made it pretty clear that the configuration of a sorter would be in the type and not at call time. I think that we can at least agree on that point.

Morwenn avatar Jan 05 '16 22:01 Morwenn