c code for some common datastructure