Here is the idea and the python code:
http://stevehanov.ca/blog/index.php?id=114
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
the idea is always keep one distance word as next node so your tree
will be something like this
dict : rat cat bat fat mat tat eat oat . bal
given ekt
ans eat : 1 down
given
pats
bats aats cats.pts ats pas pat
pat bat : ans 2 iteration
now recur
this is well known problem, use the BFS traversal / Backtracking
On Nov 26, 3:54 pm, tech coder techcoderonw...@gmail.com wrote:
i think edit distance algorithm can not be used here because in edit
distance problem we have a target string and a source string. Here we dont
have any target word.
@vikas : to do BFS ..first you have to create tree . so what basis will you
create a tree ? a dictionary can contains thousandss of word , just by
taking arbitrary word from the dictionary and creating tree i guess
will take lot of time.
@tech coder : target will be the words from the
@vikas will u please elaborate ur answer.
@atul yeah thats true, target will be the words from the dictionary but we
dont have a specific target, here it will be brute force if we check newly
form word with each of the word in dictionary.
On Sat, Nov 26, 2011 at 9:15 PM, atul anand