FB更邪恶了,电视台可以随时剽窃你的言论# PDA - 掌中宝
r*7
1 楼
Given a source string and a destination string write a program to display
sequence of strings to travel from source to destination. Rules for
traversing:
1. You can only change one character at a time
2. Any resulting word has to be a valid word from dictionary
Example: Given source word CAT and destination word DOG , one of the valid
sequence would be
CAT -> COT -> DOT -> DOG
Another valid sequence can be
CAT -> COT - > COG -> DOG
One character can change at one time and every resulting word has be a valid
word from dictionary
CareerCup 有这道题,但是找不到Java解法。。。 本人菜鸟一枚,只会JAVA。
有人说要用BFS来做,然后华丽的不会了。。。
sequence of strings to travel from source to destination. Rules for
traversing:
1. You can only change one character at a time
2. Any resulting word has to be a valid word from dictionary
Example: Given source word CAT and destination word DOG , one of the valid
sequence would be
CAT -> COT -> DOT -> DOG
Another valid sequence can be
CAT -> COT - > COG -> DOG
One character can change at one time and every resulting word has be a valid
word from dictionary
CareerCup 有这道题,但是找不到Java解法。。。 本人菜鸟一枚,只会JAVA。
有人说要用BFS来做,然后华丽的不会了。。。