Write a static Recursive method isPermutation, Java Development Recursive Question

Write a static Recursive method isPermutation, Java Development Recursive Question

Write a static Recursive method isPermutation which has the following signature:

public static boolean isPermutation (int [] a, int [] b)

Which receives 2 int arrays which are filled with integers and returns true if they are a permutation one of another. means they contains the exact same of elements, but they may appear in a different order.

For example:

if b = {3, 2, 4, 1} a = {1, 2, 3, 4} then method would return true.

if b = {3, 2, 4, 4}  a = {4, 2, 3, 4} then method would return true 

if b = {1, 2, 4, 2} a = {1, 2, 4, 4} then method would return false

if b = {3, 2, 4, 5} a = {1, 2, 3, 4} then method would return false

if b = {3, 2, 4, 1, 5}  a = {1, 2, 3, 4} then method would return false

Notice – No need to consider the complexity.

the method must be recursive. no use of Loops at all.

You can use overloading but not in external functions.

You cannot use Global static variables

You cannot use a helper array (It must run on the original array)

"You need a similar assignment done from scratch? Our qualified writers will help you with a guaranteed AI-free & plagiarism-free A+ quality paper, Confidentiality, Timely delivery & Livechat/phone Support.


Discount Code: CIPD30



Click ORDER NOW..

order custom paper