Re: [algogeeks] Re: Adobe Noida Interview Question

2012-05-01 Thread Ashish Goel
for second question think of the given string as some overlapping strings with overlap length of length(pattern) -1. now appy strstr/KMP in parallel to these substrings Best Regards Ashish Goel "Think positive and find fuel in failure" +919985813081 +919966006652 On Tue, May 1, 2012 at 11:36 A

[algogeeks] Re: Adobe Noida Interview Question

2012-04-30 Thread vikas
1) you cannot escape but exhaustive search, trying all possibilities 2) basically you are asked to find string in stream, just try to do similar of Boyce-Moore , seems good for this problem. On Mar 30, 8:47 pm, Decipher wrote: > This was asked from my friend in January for MTS profile. > > Q1) G

Re: [algogeeks] Re: Adobe Noida Interview Question

2012-04-29 Thread WgpShashank
Q2. better approach will be using KMP or Boyce Moore. -- *Thanks Shashank Mani Narayan Computer Science & Engineering Birla Institute of Technology,Mesra **Founder Cracking The Code Lab "http://shashank7s.blogspot.com/"; FB Page http://www.facebook.com/LestCode

Re: [algogeeks] Re: Adobe Noida Interview Question

2012-04-01 Thread atul anand
Q2 can be done using KMP algo or suffix tree On Sun, Apr 1, 2012 at 1:12 PM, Decipher wrote: > Q1) Yes, as per my friend the only interface is that function. But how > will you traverse the matrix because if : BADCAT is one row then there are > two words BAD and CAT and you have to find both and

[algogeeks] Re: Adobe Noida Interview Question

2012-04-01 Thread Decipher
Q1) Yes, as per my friend the only interface is that function. But how will you traverse the matrix because if : BADCAT is one row then there are two words BAD and CAT and you have to find both and it could be DAB and TAC also ? Q2) What will be the complexity when state machine is used ? --

[algogeeks] Re: Adobe Noida Interview Question

2012-03-31 Thread Don
Q1) The only interface to the dictionary is this binary function? It would be very helpful to know if there are words in the dictionary with a given prefix. If the requirement is to find all words in the matrix, as you stated, there is not a better option than to loop over every string which can be