roarin-roran / Sorting

0 stars 0 forks source link

detect descending runs #77

Open roarin-roran opened 2 years ago

roarin-roran commented 2 years ago

currently only ascending runs are detected.

try out adding descending run detection by forking at the start of a run: if the next element is smaller, the run is descending and vice versa.

if this is noticeably slower, consider a new modular option here @sebawild? to measure the effects of forking like this

sebawild commented 2 years ago

Yeah; not only can the extra check be slightly slower, we might also want to compare the two variants (also for mergecost).

What does a “modular option” mean in actual Python?

roarin-roran commented 2 years ago

currently, we have sorters, mergers, and ipqs - all intended to be mutually intercompatible. I'm considering adding run detectors to that list