Write a recursive method that has as arguments an array of characters and two bounds on array

Question:

Write a recursive method that has as arguments an array of characters and two bounds on array indexes. The method should reverse the order of those entries in the array whose indexes are between the two bounds (inclusive). For example, suppose the array is:

a[0] = 'A' a[1] = 'B' a[2] = 'C'

a[3] = 'D' a[4] = 'E'

and the bounds are 1 and 4. Then, after the method

is run, the array elements should be:

a[0] = 'A' a[1] = 'E' a[2] = 'D'

a[3] = ‘C’ a[4] = 'B'

Embed the method in a program and test it.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: