Question: code in python i For this task, you may assume that all Double Key Table and all Infinite Hash Table methods are O(1), even if

code in python

For this task, you may assume that all Double Key Table and all Infinite Hash Table methods are O(1), even if they obviously \begin{tabular}{|l|c|c|c|c|c|c|c|c|c|c|} \hline Name & \( \mathrm{m} 1 \) & \( \mathrm{~m} 2 \) & \( \mathrm{~m} 3 \) & \( \m   

i For this task, you may assume that all Double Key Table and all Infinite Hash Table methods are O(1), even if they obviously are not. Also note you're welcome to edit and add additional functionality to mountain.py In this task, you'll be working on: mountain_organiser.py As you embark on your Mountain Climbing journey, you find that as time passes, the number of mountains you can climb increases. For the first week, maybe you can only do low-altitude, non-steep mountains, and as time goes on, you can climb more and more difficult mountains. As you climb more and more mountains, you'd like to know the rank of each mountain, if all the mountains you've seen are ranked by their difficulty increasing. In cases where the difficulty is the same, you should order them by name lexicographically increasing (you can assume this is unique) To achieve this, we'd like you to implement the MountainOrganiser class (in mountain_organiser.py), which requires 3 methods: __init__ Initialisation add_mountains (self, mountains: list [Mountain]) -> None: Adds a list of mountains to the organiser cur_position(self, mountain: Mountain) -> int : Finds the rank of the provided mountain given all mountains included so far. See below for an example. Raises KeyError if this mountain hasn't been added yet. i Complexity Requirement add_mountains should have complexity at most O(M log(M) + N), where M is the length of the input list, and N is the total number of mountains included so far. cur_position should have complexity at most O(log(N)), where N is the total number of mountains included so far. Consider the following example:

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!