Question: Problem 1 (USE C ++ AND EXPLAIN AND SHOW THE STEPS) 1. Consider the following function (K is the size of array A and L
Problem 1 (USE C ++ AND EXPLAIN AND SHOW THE STEPS) 1. Consider the following function (K is the size of array A and L is the size of array B) bool func (int A[], int K, int B[], int L, int start) { 1. if (L > K-start) 2. return false; 3. for (int i =0; i < L; i++) 4. { 5. if(A[start+i] != B[i]) 6. return false 7. } 8. return true; } a) What are the input and output variables to this function. b) Trace it for the following call: int F[] = {1, 3, 5, 2, 3, 4, 6}; int S[] = {2, 3, 4}; bool res = funct (F, 7, S, 3, 3); c) You could also trace it for res = funct(F, 7, S, 3, 2); d) Discover what does the function funct do? 2. a) Write a function that accepts two arrays and returns true if the second array is within the first array and returns false if not. b) Write a main function where you make a call to your function with appropriate variables of your choice.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
