|
|
|
|
|
|
h*****b 发帖数: 59 | 1 Origin Destination
Seattle LA
LA Miami
LA Maine
Miami Seattle
Seattle Miami
Write a method find_routes(origin, destination) that efficiently outputs all
possible routes from the origin to the destination. For example, the
solution to find_routes(‘Seattle’, ‘Miami’) should be Seattle -> Miami
and Seattle -> LA -> Miami
大家用什么方法做牙?? | p*****2 发帖数: 21240 | | m*****k 发帖数: 731 | 3 change "print path from root to all leaves" solution
to
"print path from root to certain node" 就行了吧. | p*****2 发帖数: 21240 | 4
要print所有的path吧?
【在 m*****k 的大作中提到】 : change "print path from root to all leaves" solution : to : "print path from root to certain node" 就行了吧.
| m*****k 发帖数: 731 | 5 Yes, by certain I mean Node.value == 'miami' in this case.
【在 p*****2 的大作中提到】 : : 要print所有的path吧?
|
|
|
|
|
|
|