mardi 6 janvier 2015

Find path from departure to destination

Good day I just got a question which is the following


you have an vector like this



[JFK, LXA, SNA, RKJ, LXA, SNA]


each 2 group define a route. so,



JFK -> LXA
SNA -> RKJ
LXA -> SNA


Find the path from departure to destination. note: departure and destination are not known.


The final destination should be



JFK-> LXA -> SNA -> RKJ


The function signature is something like this



vector<string> findPath(vector<string> airports)
{

}

Aucun commentaire:

Enregistrer un commentaire