Question: 2) The following function is written to search for a subsequence in a sequence where the elements of sequences are in two separate linked lists.

2) The following function is written to search for a subsequence in a sequence where the elements of sequences are in two separate linked lists. For example, observe that for the sequence containing the characters abcabba, the subsequences "abc, cabba", "abba, bca", "abcabba", "a" are some of the subsequences that are all contained in it. But the subsequences "bcb", bcbab, cb are not in the sequence. The parameters of the function are pointers that point to the first elements of these linked lists, i.e. the first parameter points to the first element of the sequence and latter points to the first element of the subsequence. Complete the missing parts. int search (struct node *s, struct node *subs) { struct node *cp=subs; if return 0; while if cp-cp->nextPtr; else! 1 1 if (cp==NULL) (ep-- return else return
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
