Redian新闻
>
在FragranceNet上买的贝佳斯绿泥可靠不?
avatar
在FragranceNet上买的贝佳斯绿泥可靠不?# Fashion - 美丽时尚
h*o
1
两题有什么本质区别使得你们会想到一题用DP, 另一题用BFS?
1. Edit Distance:
-----------------
Given two words word1 and word2, find the minimum number of steps required
to convert word1 to word2. (each operation is counted as 1 step.)
You have the following 3 operations permitted on a word:
a) Insert a character
b) Delete a character
c) Replace a character
2. Word Ladder
-----------------
Given two words (start and end), and a dictionary, find the length of
shortest transformation sequence from start to end, such that:
Only one letter can be changed at a time
Each intermediate word must exist in the dictionary
avatar
b*t
2
在FragranceNet.com上买的贝佳斯绿泥刚邮到了,发现瓶上的标签稍有点贴歪,会不会
是假货?以前没在这个网站在买东西,labor day那天看到她家有15%折扣就买了,之前
的标价是$44.50.
avatar
W*8
3
第二个不能insert or delete,只能exchange。
所以第二个的可能性大大减少,不需要用DP,用BFS就可以解决。
avatar
k*a
4
用起来没啥区别……
avatar
g*o
5
我也有疑问 word ladder能不能用A*搜索 会不会比bfs要好

【在 h**o 的大作中提到】
: 两题有什么本质区别使得你们会想到一题用DP, 另一题用BFS?
: 1. Edit Distance:
: -----------------
: Given two words word1 and word2, find the minimum number of steps required
: to convert word1 to word2. (each operation is counted as 1 step.)
: You have the following 3 operations permitted on a word:
: a) Insert a character
: b) Delete a character
: c) Replace a character
: 2. Word Ladder

avatar
h*o
6
Thanks

【在 W*****8 的大作中提到】
: 第二个不能insert or delete,只能exchange。
: 所以第二个的可能性大大减少,不需要用DP,用BFS就可以解决。

avatar
g*c
7
好问题
都有source和target,都求最少多少步

【在 h**o 的大作中提到】
: 两题有什么本质区别使得你们会想到一题用DP, 另一题用BFS?
: 1. Edit Distance:
: -----------------
: Given two words word1 and word2, find the minimum number of steps required
: to convert word1 to word2. (each operation is counted as 1 step.)
: You have the following 3 operations permitted on a word:
: a) Insert a character
: b) Delete a character
: c) Replace a character
: 2. Word Ladder

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。