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.)



You are given a dictionary of all valid words. You have the following 3 operations permitted on a wo..

Answer / Rashmi Yadav

The minimum number of steps can be found by using a dynamic programming approach such as Floyd-Warshall algorithm or Dijkstra's shortest path algorithm, which both have time complexity O(n^3). In C language, you can implement this using the edit distance algorithm.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Programming Languages AllOther Interview Questions

how many types of operating system are avaliable?

1 Answers   IBM,


WHAT IS NV RAM ?

3 Answers  


what is integration testing in real time applications?

1 Answers   CTS,


Which tag is used to create table row

2 Answers  


which worker is involved in all the phases of SDLC?

1 Answers  


how do you generate source code for the automatic generation for receipt number

2 Answers   Infosys,


how many keywords are present in "c"?

18 Answers   Assurgent, Cynosure Software, IBM,


Binary tree?

1 Answers   Mascot,


I'm new to ABAP. What is Module pool in SAP?

1 Answers   TCS,


What is the use of Differ interface check box in Ship confirm?

1 Answers  


SAS question: I have 50 fils a1,a2,...,a50. the primary key is upc. then if i want to merge all 50 files, the code is as follows, data test; merge a1 ... a50; by upc; run; we know that writing all 50 files name is time consuming, is there any standard format of this code?

1 Answers   Symphony,


HOW TO FIND NUMBER OF TWOS IN N!(N FACTORIAL)??

1 Answers  


Categories