Ask Question
21 October, 10:44

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.)

+1
Answers (1)
  1. 21 October, 14:28
    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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers