C implementation of several data structures