Question | Computer Science homework help

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

Calculate Your Essay Price
(550 words)

Approximate price: $22

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more