CSD203_-_PE1_-_FA2024_2925.webp
G

CSD203_-_PE1_-_FA2024_2925.webp

Zoom
Typhoon Name Managem 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, node) of the BST to display all typhoon names in preorder sequence.
Question 3. AVL Tree for Optimized Searching (3 marks):
• Task 1: To improve the efficiency of search operations in the BST, implement an AVLTree class for insert, delete and search operations. An AVL Tree is a self-balancing BST that performs rotations to maintain balance after insertions.
Task 2: Discuss the advantages and disadvantages of using an AVL Tree compared

+ 139%
Close
Chưa có bình luận nào.

Thông tin

Category
CSD203
Thêm bởi
graceful_beauty1
Ngày thêm
Lượt xem
619
Lượt bình luận
0
Rating
0.00 star(s) 0 đánh giá

Image metadata

Filename
CSD203_-_PE1_-_FA2024_2925.webp
File size
472.3 KB
Dimensions
1920px x 867px

Share this media

Back
Bên trên Bottom