Inverse of an array

Inverse of an array by recursive method

@kumarakash121005 do you want the logic for reversing the array recursively or have any doubts in that?

Logic for recursive solution

  • Initialize start and end indexes as start = 0, end = n-1
  • make a reverse function with parameters array, start and end
  • Swap arr[start] with arr[end]
  • Recursively call reverse function for rest of the array after incrementing start and decrementing end.
  • break the recursion if start >= end.

try making the code with this if got any error let me know.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

not reverse it is inverse of array