Saturday, April 24, 2010
You are given a dictionary of all valid words. You have the following 3 operations permitted on a word: delete a character, insert a character, replace a character. Now given two words - word1 and word2 - find the minimum number of steps required to convert word1 to word2. (one operation counts as 1 step.)
Subscribe to:
Post Comments (Atom)
We can use suffix tree and find the minimum number of insertions or deletions
ReplyDeleteYou can use edit-distance algorithm for this. Read page 174 of this pdf.... http://www.cs.berkeley.edu/~vazirani/algorithms/chap6.pdf
ReplyDelete