For my reference, an implementation of several data structures