PRACTICAL EXAM - CSD203 - FA24
Duration: 60 minutes
Typhoon Name Management System
Typhoons are powerful storms that form in the western Pacific Ocean. These storms can cause severe damage to coastal regions due to their high winds and heavy rainfall. To improve communication and tracking, each typhoon is given a name. The naming of typhoons follows a predetermined list contributed by various countries in the Asia-Pacific region. For example, countries like Japan, the Philippines, Vietnam, and South Korea each contribute specific names that are rotated through as new typhoons are identified.
In this exam, you will implement a system to manage typhoon data, including their names and the countries that named them, using different data structures. You will load typhoon data from a file(typhoon_data.csv), store it in a linked list, and explore more advanced data structures like Binary Search Trees (BST) and AVL trees to efficiently manage and query this dataset.
Question 1. Typhoon Class and Linked List Implementation (2 marks):
• Task 1: Create a class Typhoon that represents a typhoon's name and the country that named it.
• Task 2: Implement a singly linked list class Typhoon LinkedList to store the typhoon data loaded from the provided file. Write a function def
load_typhoon_data(filename) to read the file and append each typhoon to the linked list.
• Task 3: Discuss the advantages and disadvantages of using a linked list for storing this type of data( by commenting in code).
Question 2. Binary Search Tree (BST) Construction (3 marks):
Task 1: Construct a Binary Search Tree class TyphoonBST to store the typhoon data, where the comparison is made based on the typhoon's name. Implement
insert, delete and search operations.Task 2. Implement a method def preorder traversal/self nodel of the BST to
Zoom
150%
Close