@anup : the time complexity will be very high ... O(n*M*M)...n=#characters
to be checked...M=size of the matrix ...

On Sat, Sep 17, 2011 at 8:30 AM, Anup Ghatage <ghat...@gmail.com> wrote:

> As WgpShashank once pointed out.
>
> Search the whole matrix for the first character instances, for each
> instance, send the array, string and that char's position to a function that
> will recursively check its direct neighbors for the next character.
> Exhaustively check like that for each starting characters appearance till
> you find the string, if any.
>
> On Fri, Sep 16, 2011 at 11:55 PM, Ankur Garg <ankurga...@gmail.com> wrote:
>
>> In a matrix of. characters, find an string. String can be in any way (all
>> 8 neighbours to be considered)
>> like find Microsoft in below matrix.
>>
>>  A
>> C
>> P
>> *R
>> *C*
>> *X
>> *S
>> **O
>> *P
>> *C*
>> V
>> *O*
>> V
>> N
>> *I*
>> W
>> G
>> *F
>> **M
>> *N
>> Q
>> A
>> *T*
>> I
>> T
>>
>> *Any Ideas How to Solve/Approach this problem ?*
>>
>>
>>  --
>> 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
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
> Anup Ghatage
>
>  --
> 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
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 

**Please do not print this e-mail until urgent requirement. Go Green!!
Save Papers <=> Save Trees
*BharatKumar Bagana*
**http://www.google.com/profiles/bagana.bharatkumar<http://www.google.com/profiles/bagana.bharatkumar>
*
Mobile +91 8056127652*
<bagana.bharatku...@gmail.com>

-- 
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 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to