6. [0.5 points] Test your implementation.
Q2. (PE_FA25_Q2.py) Write a MinHeap class which includes:
1. [0.5 points] Route class to encapsulate route identification (rid), City 1 (name), City2 (name),
and travel time (number) between City1 and City2. Write compareTo method to compare with
another route in terms of travel time.
2. A MinHeap (Min Heap tree) class, implemented using an array-based structure, is designed
to store and manage data based on compareTo method. The class is responsible for efficiently
handling the following operations:
2.1 [1 point] Create necessary parameters to manage the tree.
2.2 [1 point] Create insert method to insert a route into the MinHeap. It is required that
compareTo method for comparison of travel time must be used to maintain the characteristics of
Min Heap after inserting a route.
2.3 [0.5 points] Create inOrderTraverse method to traverse the tree using in-order traversal.
2.4 [1 point] Create quickSort method to sort the routes in the increasing order of travel time.
3. Test your implementation with the following tasks:
3.1 [0.5 point] Create an instance of the BST and add the models to the tree.
3.2 [0.5 points] Perform the in-order traversal and print the list of the models on the screen.
Q.3 (PE_FA25_Q3.py) [1.5 points] Write a script to do the following task.
In addition to travel time there is a travel fee (the arav nart of the table) for each route as below
+ 100%
Zoom
Close