dynamic memory allocation in data structure