Question: Write a C function int find_pattern(char *s, char * pattern) to find a pattern within a string. 1. The function should return the first position
Write a C function int find_pattern(char *s, char * pattern) to find a pattern within a string.
1. The function should return the first position of the pattern in the string or -1 if the pattern is not found.
2. What is the Big O of your functions algorithm based on the size of the pattern and the string?
3. What would be a worst-case pattern and string for your functions algorithm?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
