Question 4 [12 marks]
(a) Define a function, F, with the signature below such that F returns true when the sequence of n values in the array b starting at position i is identical to the sequence of n values in array c starting from position j. (4 marks)
function F(b: array<int>, c: array<int>, i: int, j: int, n: int): bool
(b) Specify a method, E, with the signature below such that E returns the largest common sequence of values in arrays b and c. Your specification may refer to function F above.
(5 marks)
method E(b: array<int>, c: array<int>) returns (r: array<int>)
(c) Specify a method, G, with the signature below such that G removes the sequence of n values starting at position i from array b. (3 marks)
method G(b: array<int>, i: int, n: int)