InterviewSolution
Saved Bookmarks
| 1. |
Give the pseudo code to compute the distance between two city objects? |
|
Answer» The following pseudo code will compute the distance between two city objects: distance(city 1, city2): 1t1, 1g1: = getlat (city1), getlon (city1) 1t2, 1g2: = getlat (city2), getlon (city2) return ((1t1 – 1t2) ** 2 + (1g1 – 1g2) ** 2)1/2 |
|