3 ms·
Binary search tree rotations are hard to implement correctly, but relatively easy to test that you have them right. There are a lot of subtleties in any stocha
by aidenn0 10y ago
Binary search tree rotations are hard to implement correctly, but relatively easy to test that you have them right.
There are a lot of subtleties in any stochastic algorithm (like a skip list) that are much harder to correctly test.
While we're discussing "easy to implement" algorithms, I find Tries (aka radix trees) to be by far the easiest to implement for both ordered and unordered sets/maps. Naive implementations are very space inefficient though.