bool mapClass::IsPath(int OriginCity, int DestinationCity) { int NextCity; bool Success, Done; // mark the current city as visited MarkVisited(OriginCity); // base case: the destination is reached if (OriginCity == DestinationCity) return true; else // try a flight to each unvisited city { Done = false; GetNextCity(OriginCity, NextCity, Success); while (Success && !Done) { Done = IsPath(NextCity, DestinationCity); if (!Done) GetNextCity(OriginCity, NextCity, Success); } // end while return Done; } // end if } // end IsPath