Write a method called CompareArrays that takes as input two arrays of same size and same type
Fantastic news! We've Found the answer you've been seeking!
Question:
Write a method called CompareArrays that takes as input two arrays of same size and same type int, then it compares between the arrays' cells, which have the same index (for example, if T1 and T2, of size 2, are the input arrays then T1 [0] will be compared with T2 [0], T1 [1] will be compared with T2 [1]). The method returns true if, for each pair, value of the first cell is bigger than the value of the second array (T1 [0] > T2 [0] AND T1 [1] > T2 [1]), and returns false otherwise.
- Write the recursive version of CompareArrays method, which you call it CompareArraysRecursive.
- Call both methods in a main method, and using two arrays of your choice (you can have them predefined in the main method, no need for user input)
Related Book For
Data Structures and Algorithm Analysis in Java
ISBN: 978-0132576277
3rd edition
Authors: Mark A. Weiss
Posted Date: