Question: Given an array A storing m integer values and an array B storing n integer value, write in pseudocode an algorithm subarray(A, B, m, n)
Given an array A storing m integer values and an array B storing n integer value, write in pseudocode an algorithm subarray(A, B, m, n) that returns the value true is A is a sub-array of B and it returns false otherwise.

11. [14 marks] Given an array A storing m integer values and an array B storing n integer values, write in pseudocode an algorithm subarray(A, B, m, n) that returns the value true if A is a sub-array of B and it returns false otherwise. A is a sub-array of B if there is a value 0SjSn-m such that A0- B, A- Blj +1], , Alm]- Blj+m-1], i.e., if the values of A appear in consecutive positions of B. For example, for the arrays A and B shown below the algorithm must return the value true, but for the arrays A' and B, the algorithm must return the value false. A8 47B1475 8 47155 A15 8
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
