It would probably be nice to add a binary trie implementation to Pyrival for maximizing xor. But this implementation is just not good enough.
Btw one fundamental error in your implementation is that you claim that max_and and max_or run in O(log n) time, which is simply not true. I'm not even sure that it is possible to make a data-structure that support max_and and max_or in O(log n) time.
It would probably be nice to add a binary trie implementation to Pyrival for maximizing xor. But this implementation is just not good enough.
Btw one fundamental error in your implementation is that you claim that
max_and
andmax_or
run inO(log n)
time, which is simply not true. I'm not even sure that it is possible to make a data-structure that supportmax_and
andmax_or
inO(log n)
time.