Basic Datastructure and related problem