TP05-Linked list
TP05-Linked list
➢ Objective: Deadline:
• To practice create linked list advanced data structure that is able to store
6 days
unlimited data
• Apply C++ programming
➢ Individual work
➢ Submit to Moodle (do not zip)
• A pdf report (cover, exercise and solution with screenshot)
• Source codes
Write C++ programs to create and implement linked list data structure below.
1. Given a list below. Describe what does it store. Let’s create structures that can hold all of those data.
An example
Another detail example
Remark: Do not write the full implementation of linked list. You are just asked to define two structures
such as the element structure and the list structure.
2. Define a data structure that can store unlimited data of ITC students. Each student has ID, name,
year and program degree. Let’s create an element for student then a list that contains head, tail and
pointer.
4. Create a function to display all data in the list that implemented in the exercises 2 and 3 above. Test
your program in main. Finally, add 2 more students to the list. Display all data.
5. Write a program that can store numbers as many as possible using linked list data structure. The
program ask user for a number at a time then add to the list. Keep asking the user for another
number and add to the list if the input number is not 0.
a. When the user inputs 0 twice, display all data in the list and stop the program.
b. Finally, compute the summation of all data in the list and show the result.