Definition of a method isreverse


Discussion:

Q: Write the definition of a method, isReverse , whose two parameters are arrays of integers 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.)

So, suppose you had two int arrays, forward and backward, each with 4 elements. Now suppose that forward had these elements: 1, 2, 3, 4 and that backward had these: values 4, 3, 2, 1.

Then if your isReverse method were invoked, passing it forward and backward, it would return true.

Explain in detail to aid learning process

 

Solution Preview :

Prepared by a verified Expert
Data Structure & Algorithms: Definition of a method isreverse
Reference No:- TGS01931909

Now Priced at $20 (50% Discount)

Recommended (97%)

Rated (4.9/5)