Given a string A, and a string B, and a dictionary, how would you
convert A to B in the minimum no of operations, given that:
i) All the intermediate words must be from the dictionary
ii) An ‘operation’ is defined as:
a) Delete any character from a string ex dog → do
b) Insert any character
can be done in O(n^2) also
below is a rough pseudocode
initialize visited[v]=0
for every vertex v{
call dfs(v)
check if al visited are 1 or not
if all visited break;
else do visited[v]=0 again.
}
correcf me if i'm missing anything
On Fri, Jul 16, 2010 at 5:38 AM, Gene
question please...
Best Regards
Ashish Goel
Think positive and find fuel in failure
+919985813081
+919966006652
On Fri, Jul 16, 2010 at 4:43 PM, manish bhatia mb_mani...@yahoo.com wrote:
It doesn't work
A =
92 87 81 72 70 61 53 22 18 17
B =
79 78 74 68 64 62 57 34 29 24
C (GOLD) =
http://en.wikipedia.org/wiki/Levenshtein_distance
Best Regards
Ashish Goel
Think positive and find fuel in failure
+919985813081
+919966006652
On Sun, Jul 18, 2010 at 6:08 PM, Ratnesh Thakur
ratneshthaku...@gmail.comwrote:
Given a string A, and a string B, and a dictionary, how would you
@jalaj..he has asked for a linear algo
On Sat, Jul 17, 2010 at 12:47 AM, jalaj jaiswal
jalaj.jaiswa...@gmail.comwrote:
can be done in O(n^2) also
below is a rough pseudocode
initialize visited[v]=0
for every vertex v{
call dfs(v)
check if al visited are 1 or not
if all
At the time of logging, the timestamp can be added to a B-tree, with
the nodes having the line number(i.e., number of bytes to be skipped
from the beginning). At the time of searching, simple logarithmic time
search will directly return the line address.
On Jul 17, 11:27 pm, vijay
Puzzle, A square Island surrounded by bigger square, and in between
there is infinite depth water. The distance between them is L. The
wooden blocks of L are given.
The L length block can't be placed in between to cross it, as it will
fall in water (just fitting).
How would you cross using these L
Given a lot of cuboid boxes with different length, breadth and height.
We need to find the maximum subset which can fit into each other.
For example:
If Box 1 has LBH as 7 8 9
If Box 2 has LBH as 5 6 8
If Box 3 has LBH as 5 8 7
If Box 4 has LBH as 4 4 4
then answer is 1,2,4
A box can fit into
@ashish: AAA is the prefix of the string and it is valid as a prefix and
it's only used for strings with length = 6 (where it is a valid prefix)
actually only dp[i][j] where i==j counts the number of such strings and
otherwise there is no string where i!=j and it that case dp[i][j] counts the
Use the block of size L, use the diagonal of the block (diagonal would be
definitely L ) to fit in between two square islands.
Thanks,
On Sun, Jul 18, 2010 at 11:38 PM, amit amitjaspal...@gmail.com wrote:
Puzzle, A square Island surrounded by bigger square, and in between
there is infinite
@Kushwaha
Your programe is wrong.
Try this input:
a[ ] = {30,25,19,16,14};
b[ ] = {20,18,12,10,8};
the right answer should be 50 48 45 43 42
but the program output is 50 48 45 43 37。
2010/5/2 Jitendra Kushwaha jitendra.th...@gmail.com
Here is a solution of O(n) , taking 4 pointers 2 for
11 matches
Mail list logo