COMP 2412 Assignemnt 3

COMP 2412
Assignemnt 3
Due: 8th November 2019
Total Marks: 10X4=40
a. Please submit all program files together in a .zip file.
b. Each question has 10 marks.
You have to implement the following four programs completely using C or C++. Please test
your programs before the submission.
1. Write a program that reads a file and builds a list. After the list is built, display it on the
monitor. You may use any appropriate data structure, but it should have a key filed and
data. Two possibilities are a list of your favorite CDs or your friend’s telephone numbers.
Use a linked list implementation.
2. Modify the program you wrote above. After you create the file, the program should present
the user with a menu to insert new data, remove existing data, or print a list of all data.
3. Write a program to read a list of students from a file and create a list. The program should
use a linked list for implementation. Each node in the linked list should have the student’s
name, a pointer to the next student, and a pointer to a linked list of scores. There may be
up to four scores for each student.
4. Write a program that will do the followings:
a) Generate 100 random numbers between 50 to 500.
b) Store these numbers in a file.
c) Read these numbers from the file and build a min heap (including all these numbers)
d) Then remove 10 elements from this heap (total 10 delete operations, remove one item
in one delete operation)

Leave a Reply

Your email address will not be published. Required fields are marked *