Changes

272 bytes added ,  16:25, 30 September 2013
no edit summary
Line 1: Line 1: −
Will return the name and location of the closest city to the specified point in space. To do this correctly, you may want to use an algorithm using a PriorityQueue, such as  [http://www.cs.umd.edu/users/meesh/cmsc420/Notes/neighbornotes/incnear.pdf this] or [http://www.cs.umd.edu/users/meesh/cmsc420/Notes/neighbornotes/incnear2.pdf this] - otherwise, you might not be fast enough.
+
Will return the name and location of the closest city to the specified point in the spatial map, where the set of valid cities excludes isolated cities. To do this correctly, you may want to use the PriorityQueue from part 1 ([http://www.cs.umd.edu/users/meesh/cmsc420/Notes/neighbornotes/incnear.pdf this] or [http://www.cs.umd.edu/users/meesh/cmsc420/Notes/neighbornotes/incnear2.pdf this])–otherwise, you might not be fast enough. In the case of a tie (two cities equally far away from the point), choose the city with the asciibetically least name. The ordering by name is asciibetical according to the java.lang.String.compareTo() method.
    
== Parameters (In output order) ==
 
== Parameters (In output order) ==
Line 12: Line 12:     
== Possible ''<error>'' types ==
 
== Possible ''<error>'' types ==
* mapIsEmpty
+
* cityNotFound
    
== ''<success>'' Example ==
 
== ''<success>'' Example ==
 
<code>
 
<code>
 
     <success>
 
     <success>
         <command name="nearestCity"/>
+
         <command name="nearestCity" id="8"/>
 
         <parameters>
 
         <parameters>
 
             <x value="1"/>
 
             <x value="1"/>
editor
68

edits