Searching Earthquake Data: Coding The Closest Quakes
This document discusses finding the closest earthquakes to a specific location by latitude and longitude. It proposes a 7-step process to find the closest or minimal quake without repeating quakes, first finding the single closest quake and then expanding the search to find the top 10 closest quakes without changing the original parameters. An example location given is Jakarta, Indonesia.
Searching Earthquake Data: Coding The Closest Quakes
This document discusses finding the closest earthquakes to a specific location by latitude and longitude. It proposes a 7-step process to find the closest or minimal quake without repeating quakes, first finding the single closest quake and then expanding the search to find the top 10 closest quakes without changing the original parameters. An example location given is Jakarta, Indonesia.
Is (lat,long) a Danger Zone? • How do we find ten closest quakes? • For specific location • For any number, not just ten Is (lat,long) a Danger Zone? • How do we find ten closest quakes? • For specific location • For any number, not just ten • Find closest or minimal quake? • Repeat, but must make sure we don't find the same minimal quake • Avoid changing parameter, make copy • We'll use 10 and Jakarta, but changeable Seven-Step Process • Can you find the closest quake? • You've found minimal or maximal element before, use same steps • Remember index of minimal quake and update after comparing each quake
• Anticipate repeating, cross out quake
after it has been considered • Programming analog is remove from ArrayList