baryluk/bbtree — Issue #2: Create heavy-asserted version with invariant checking.
Author: baryluk
Created: 2011-10-31 06:36:52+00:00
State: open

We should at least check invariants every time we cross public interfaces boundouaries.

Most importantly, every time we receive bbtree from outside, or return bbtree somewhere, everywhere we pass valid bbtree, we actually should check it is valid bbtree (check bounding factors). If not, crash program, dump input and output trees.

It is very heavy, and of course not sane for normal usage (all operations will grow from O(log n), to O(n) or even O(n log n)!), but useful for (random) testing and validating implementation.

Provide conditional compilation directives to switch it on / off. (Runtime control is not necessary, as it will incur some additional overhead, and isn't really needed).