@ Anand, No , It doesnt
Try with String2 = LH
String1 = HELLO.
I think LCS solves a different problem from the one being asked here.
I think we must generate all possible combination of strings and for each
combination , check if all chars from str2 is present in it.
On Sun, Aug 1, 2010 at
all the solutions mentioned above are not complete
1)need to solve this problem with sliding window concept
2)its O(n)
On Wed, Aug 11, 2010 at 2:43 PM, Algoose chase harishp...@gmail.com wrote:
@ Anand, No , It doesnt
Try with String2 = LH
String1 = HELLO.
I think LCS solves a
@all:u need to calculate the hash value of very substring(no other go since
the letters are in different order we ought to do it).then apply Rain
Karp algorithm.
On Wed, Aug 11, 2010 at 2:43 PM, Algoose chase harishp...@gmail.com wrote:
@ Anand, No , It doesnt
Try with String2 = LH
solution could be to find the charcter position from both sides for each
char of s2
then from the 2*n array, find the smallest index from left and largest from
right, within these two indexes all chars would be there
one case where one of the chars can be missing can be found if a row in this
2-d
I am not sure, but can I do this using a suffix trie ? any comments ?
On Sun, Aug 1, 2010 at 2:29 PM, Ashish Goel ashg...@gmail.com wrote:
solution could be to find the charcter position from both sides for each
char of s2
then from the 2*n array, find the smallest index from left and
plz .. if any one knows dp solution then tell ...
On Sun, Aug 1, 2010 at 7:31 AM, Ashim Kapoor ashimkap...@gmail.com wrote:
I am not sure, but can I do this using a suffix trie ? any comments ?
On Sun, Aug 1, 2010 at 2:29 PM, Ashish Goel ashg...@gmail.com wrote:
solution could be to find
Using Dynamic programing(Longest common subsequence logic) we can solve this
problem in O(nm) where n is the length of the first string and m is the
length of second string. Last element of matrix which the length of the
string that matches.
http://codepad.org/cyiKEMSF
dude they dont need to be in the same order ..
how are taking care of that
On Sun, Aug 1, 2010 at 10:47 AM, Anand anandut2...@gmail.com wrote:
Using Dynamic programing(Longest common subsequence logic) we can solve
this problem in O(nm) where n is the length of the first string and m is the
Even if they are not in the same order still it works
http://codepad.org/jpCUqwpA
http://codepad.org/jpCUqwpA
On Sun, Aug 1, 2010 at 10:52 AM, srikanth sg srikanthini...@gmail.comwrote:
dude they dont need to be in the same order ..
how are taking care of that
On Sun, Aug 1, 2010 at 10:47
wat abt duplicates?
eg
THAT
TT
answer should be 1 or 4 ?
On Sun, Aug 1, 2010 at 11:22 PM, srikanth sg srikanthini...@gmail.comwrote:
dude they dont need to be in the same order ..
how are taking care of that
On Sun, Aug 1, 2010 at 10:47 AM, Anand anandut2...@gmail.com wrote:
Using Dynamic
answer should be the 2.
http://codepad.org/olNm2SoM
On Sun, Aug 1, 2010 at 10:56 AM, Nikhil Jindal fundoon...@yahoo.co.inwrote:
wat abt duplicates?
eg
THAT
TT
answer should be 1 or 4 ?
On Sun, Aug 1, 2010 at 11:22 PM, srikanth sg srikanthini...@gmail.comwrote:
dude they dont need to be
given two string , find the minimum width in string 1 containing the
all characters of string 2 , they may present in different order
string 1-HELLO
string 2- LE
answer-2
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group,
@ abv ... ab to band kar de bhai
On Sat, Jul 31, 2010 at 7:09 PM, srikanth sg srikanthini...@gmail.comwrote:
given two string , find the minimum width in string 1 containing the
all characters of string 2 , they may present in different order
string 1-HELLO
string 2- LE
answer-2
--
You
LOL :P
On Sat, Jul 31, 2010 at 8:18 AM, jalaj jaiswal jalaj.jaiswa...@gmail.comwrote:
@ abv ... ab to band kar de bhai
On Sat, Jul 31, 2010 at 7:09 PM, srikanth sg srikanthini...@gmail.comwrote:
given two string , find the minimum width in string 1 containing the
all characters of
At the moment, I can only think of an O(n^3) algo.
Maybe if you can find a hash function which computes the hash value
depending on the unique characters the string contains, you can reduce it to
O(n^2).
On Sat, Jul 31, 2010 at 7:09 PM, srikanth sg srikanthini...@gmail.comwrote:
given two
15 matches
Mail list logo