Ask Question
22 April, 04:08

Write the definition of a method, isReverse, whose two parameters are arrays of ints of equal size. The method returns true if and only if one array is the reverse of the other. ("Reverse" here means same elements but in reverse order.)

+5
Answers (1)
  1. 22 April, 04:21
    0
    The following are code in the Java Programming Language.

    //define boolean type function

    boolean isReverse (int ar[], int b[])

    {

    //declare integer type variable

    int x;

    //set the for loop

    for (x=0; x < ar. length && ar[x] = = b[ar. length-1-x]; x++);

    return x = = ar. length;

    }

    Explanation:

    The following are the description of the code.

    In the above code that is written in the Java Programming Language, we define the boolean data type function that is 'is Reverse () ' and pass two array integer data type arguments that is 'ar', 'b' in the then, declare integer data type variable that is 'x'. Set the for loop that the boolean type value is true or false.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Write the definition of a method, isReverse, whose two parameters are arrays of ints of equal size. The method returns true if and only if ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers