Question: Sequence Matching ******* Must be written in C ********** Problem 4. Sequence Matching (25 points) Sequence matching is a very interesting problem in various fields
Sequence Matching
******* Must be written in C **********
Problem 4. Sequence Matching (25 points) Sequence matching is a very interesting problem in various fields like genetics, cryptography etc. The main idea is that you are given a large sequence and a smaller sequence; you have to find whether the smaller sequence appears in any place of the large sequence. Write a program that performs this task. Your input would be 2 integers for array size and 2 integer arrays. Write a function that takes these 2 arrays as parameters and returns the index of the first occurrence of the smaller sequence in larger sequence. If no such match occurs, print proper message. Sample Input and Output: (Your code should print the red texts on the screen. Black texts are sample user inputs) Sample Input Sample Output Enter Size of A: 7 Enter A: 13 2 24 7 8 -9 0 Enter Size of B: 3 Enter B: 7 8-9 Match Found at index 3. Enter Size of A: 7 Enter A: 13 2 24 7 8-9 0 Enter B: 4 Enter Size of A: 7 890 No match found
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
