Program 4 for data structures