DSA Lab Final Exam (Spring 2023) : Allowed Time 90 Minutes
DSA Lab Final Exam (Spring 2023) : Allowed Time 90 Minutes
Version: X1
Instructions for Invigilators:
1. Students will have total 90 minutes to finish the whole exam.
2. It is up to the students to manage their time.
Question 1:
Suppose you are working for a delivery service that needs to manage all couriers
responsible for each parcel to be delivered. Each parcel is identified by a unique
tracking number. Your team has decided to use an unordered_map to store
the courier names for each parcel, with the tracking number as the key.
Write a C++ program to implement this system and support the following
operations using a menu:
1. Insert a new courier name into the map for a given tracking number
2. Delete a courier name from the map for a given tracking number
3. Print all tracking numbers and corresponding courier names in the map
4. Exit
Question 2:
Suppose you are creating a program for a university to manage its courses. A
unique integer course code represents each course. You decide to use a binary
search tree to store these course codes, with an integer value placed on each node.
Write a C++ program that provided the registrar of the university to perform the
following actions using a menu: