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 to a standard BST( by commenting in code).
Question 4: Main Function and Search Demo (2 marks)
•
Task 1: Create a main function in that:Calls load_typhoon_data(filename) to load data from the CSV file into the linked list.
Creates a Binary Search Tree (TyphoonBST) object and inserts typhoons one by one from the linked list into the BST.
Creates an AVLTree object and inserts typhoons one by one from the linked list into the AVL tree.
Performs a search operation demo on the AVL tree using a typhoon name of your choice.
Note: Submit 1 python file only with no name of student in filename, for example
Practical ExamFA24.py
Zoom
139%
Close