RecursiveComputeRouteDistance(p1index,p2index,locations,latitudes,longitudes):
recursively computes the total distance between all waypoints (route) using computeDistance function to compute
the distance between two adjacent points. You need to recursively compute the distance for the base
case(s) and the general case(s).
Sounds like the base case in this problem would be when you come down the last two waypoints? I'm not sure what the locations parameter is in RecursiveComputeRouteDistance(p1index,p2index,locations,latitudes,longitudes) - is this something that would be counting down as you calculate intermediate waypoints?
if (base case)
... do something
else (not the base case)
... call the function recursively, incrementing or decrementing one of the parameters so that the base case will eventually be reached