由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - edit distance vs. word ladder
相关主题
Amazon面试问题(Convert word1 to word2)?linkedin电面题
问一个word ladder的题目问一道字符串相关的题目。
[算法] word ladder problemamazon 面筋题怎么做?
LeetCode: Word Ladder一道题Find all words from a dictionary that are Y edit distance away.
请教个面试题airbnb就这一道题目么?
一道老题Given large text, find min cover distance of n words题目是什么意思啊?
问一道L家的题airBnb电面面经
Word Ladder几个test case 没看明白fb一题求解答
相关话题的讨论汇总
话题: word话题: ladder话题: character话题: edit话题: given
进入JobHunting版参与讨论
1 (共1页)
h**o
发帖数: 548
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
W*****8
发帖数: 186
2
第二个不能insert or delete,只能exchange。
所以第二个的可能性大大减少,不需要用DP,用BFS就可以解决。
g****o
发帖数: 547
3
我也有疑问 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

h**o
发帖数: 548
4
Thanks

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

g*c
发帖数: 4510
5
好问题
都有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

1 (共1页)
进入JobHunting版参与讨论
相关主题
fb一题求解答请教个面试题
A电面一题 基本已挂一道老题
狗狗面试官, 怎么都在抄代码。问一道L家的题
问一个字符串面试问题Word Ladder几个test case 没看明白
Amazon面试问题(Convert word1 to word2)?linkedin电面题
问一个word ladder的题目问一道字符串相关的题目。
[算法] word ladder problemamazon 面筋题怎么做?
LeetCode: Word Ladder一道题Find all words from a dictionary that are Y edit distance away.
相关话题的讨论汇总
话题: word话题: ladder话题: character话题: edit话题: given