Implementation of various data structures in C