[algogeeks] Amazon Q: Implement an algorithm to do wild card string matching

2012-05-26 Thread Ashish Goel
Implement an algorithm to do wild card string matching


Best Regards
Ashish Goel
Think positive and find fuel in failure
+919985813081
+919966006652

-- 
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.



Re: [algogeeks] Amazon Q: Implement an algorithm to do wild card string matching

2012-05-26 Thread atul anand
match(*input , *pattern)
if(*pat == 0)
 return true;

  if('?' == *pat)
return match(input+1,pat+1) || match(input,pat+1)

  if('*' == *pat)
return match(input+1,pat) || match(input,pat+1)

   if(*text == *pat)
 return match(input+1,pat+1)
  return 0;

take care of base cases..
On Sat, May 26, 2012 at 2:16 PM, Ashish Goel ashg...@gmail.com wrote:

 Implement an algorithm to do wild card string matching


 Best Regards
 Ashish Goel
 Think positive and find fuel in failure
 +919985813081
 +919966006652

 --
 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.


-- 
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.



Re: [algogeeks] Amazon Q: Implement an algorithm to do wild card string matching

2012-05-26 Thread atul anand
typo error above resolved :-

match(*input , *pattern)
if(*pat == 0)
 return true;

  if('?' == *pat)
return match(input+1,pat+1) || match(input,pat+1)

  if('*' == *pat)
return match(input+1,pat) || match(input,pat+1)

   if(*input == *pat)
 return match(input+1,pat+1)
  return 0;

On Sat, May 26, 2012 at 2:39 PM, atul anand atul.87fri...@gmail.com wrote:


 match(*input , *pattern)
 if(*pat == 0)
  return true;

   if('?' == *pat)
 return match(input+1,pat+1) || match(input,pat+1)

   if('*' == *pat)
 return match(input+1,pat) || match(input,pat+1)

if(*text == *pat)
  return match(input+1,pat+1)
   return 0;

 take care of base cases..
 On Sat, May 26, 2012 at 2:16 PM, Ashish Goel ashg...@gmail.com wrote:

 Implement an algorithm to do wild card string matching


 Best Regards
 Ashish Goel
 Think positive and find fuel in failure
 +919985813081
 +919966006652

 --
 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.




-- 
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.