A Java program which accepts a user location as a pair of co-ordinates, and returns a list of the five closest events, along with the cheapest ticket price for each event.
This program requires Java 1.8 to build and run.
To build, run the following command from the folder /src/
.
javac main/*.java
To run, run the following command from the folder /src/
.
java main.Main
To use your own seed for generating data, enter a (long) seed as an argument. For example:
java main.Main -123456
- User enters a valid coordinate in the form
x,y
.
- I would remove the check to see if coordinates already exists in an event when adding a new event.
- Alternatively, I would have coordinates store a list of Events.
- Storing events/coordinates in a set would give extremely poor performance in large world sizes when trying to find the nearest neighbours.
- Instead, I would store them in a quadtree, which would allow for much better performance in searching for the closest events.