1 search should in using KMP algo so that It can be seacrh in O(n) . let
function is int KMP(src,trget, searchDirection )
this kmpSearch funtion should be implemented is such a fashion that is
search in both direction.
3. assume that give 2d array name is array
const int row =1;
const int col =1;
const int dig =1;
for(i=0;i<M;i++) //O(n^2)
{
KMP(array,target, row); //O(n)
KMP(array,target,col ); //O(n)
KMP(array,target, dig ); //O(n)
}
result in O(n^2)
but still looking for better solution
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.