day 20 WAVL implementation completed, but slow
Without a hack, at 3 iterations, -Dscan=sqrt completes in 3.8s,
-Dscan=log completes in 6.8s and gives the same answer. At 4
iterations, -Dscan=log fails with a duplicate key; insertions are
attempted at the same index more than 15 times, which runs out of bits
on my idea of picking a key by averaging neighboring values. With the
hack of an O(n) rekey pass between each mix, the full solution works,
but 11.0s for -Dscan=sqrt vs. 18.8s for -Dscan=log says that even
though the algoithm scales better, it has a lot more overhead.
Maybe it's possible to implement without any keying: instead of
inserting by key, insert solely by position. It probably still won't
beat -Dscan=sqrt, but at least wouldn't be so hacky. At which point,
a skip list may fit better than WAVL.