Chat with us, powered by LiveChat The World Meteorological Organization (WMO) has hired you to write a data structure that stores record temperatures across the globe. Incoming temperature reports have very precise | Wridemy

The World Meteorological Organization (WMO) has hired you to write a data structure that stores record temperatures across the globe. Incoming temperature reports have very precise

The World Meteorological Organization (WMO) has hired you to write a data structure that stores record temperatures across the globe. Incoming temperature reports have very precise geo-location data (latitude and longitude coordinates). The WMO would like for you to store data in a "grid", treating any points that round to the same latitude and longitude within one decimal as the same. Note that we are using negative numbers for southern latitudes and western longitudes, so the above coordinates correspond to (36.4° N, 105.0° W). Write a data structure TempMap that keeps track of the hottest and coldest temperatures for each reported coordinate. There is a lot of data coming in, so you need to read and write this information quickly – you should be able to update the record at a (lat, long) pair in O(1). Do not use the built-in set or dictionary types in this assignment. class TempMap Write a class TempMap that keeps track of the maximum and minimum temperature for each reported set of coordinates. Magic Methods init O(1) in O(1) Returns True (False) if the rounded version of a specified coordinate is (is not) in this collection get O(1) Returns a tuple containing the (min, max) temperatures at these coordinates Raise a KeyError if the specified coordinate are not in this collection the input coordinates may or may not be rounded Non-Magic Methods add_report(pos, temp) O(1) pos – an (unrounded) tuple of coordinates temp – the current temperature at those coordinates Updates the maximum or minimum recorded temperature for pos if appropriate remove_pos(pos) O(1) removes the record for the given position from this collection raises a KeyError if pos is not in this collection Special Behavior Memory constraint – you should limit your memory usage to be between 1/2 and 2x the amount necessary to store the number of unique coordinates – that is, you should periodically increase and decrease the amount of memory used as items are added and removed. The starter code includes a function generate_report that returns a randomly generated tuple of (lat, long, temperature). Feel free to use it to help with testing

    Our website has a team of professional writers who can help you write any of your homework. They will write your papers from scratch. We also have a team of editors just to make sure all papers are of HIGH QUALITY & PLAGIARISM FREE. To make an Order you only need to click Ask A Question and we will direct you to our Order Page at WriteDemy. Then fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.

    Fill in all the assignment paper details that are required in the order form with the standard information being the page count, deadline, academic level and type of paper. It is advisable to have this information at hand so that you can quickly fill in the necessary information needed in the form for the essay writer to be immediately assigned to your writing project. Make payment for the custom essay order to enable us to assign a suitable writer to your order. Payments are made through Paypal on a secured billing page. Finally, sit back and relax.

    Do you need an answer to this or any other questions?

    About Wridemy

    We are a professional paper writing website. If you have searched a question and bumped into our website just know you are in the right place to get help in your coursework. We offer HIGH QUALITY & PLAGIARISM FREE Papers.

    How It Works

    To make an Order you only need to click on “Order Now” and we will direct you to our Order Page. Fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.

    Are there Discounts?

    All new clients are eligible for 20% off in their first Order. Our payment method is safe and secure.

    Hire a tutor today CLICK HERE to make your first order

    Related Tags

    Academic APA Writing College Course Discussion Management English Finance General Graduate History Information Justify Literature MLA