Question
1. Write a recursive function that computes the sum of all numbers from 1 to n, where n is given as parameter. Here is the
1. Write a recursive function that computes the sum of all numbers from 1 to n, where n is given as parameter.
Here is the method header: public static int sum (int n){...}
2. Write a recursive function that finds and returns the minimum value in an array, where the array and its size are given as parameters.
Here is the method header: public static int minValue (int [] data, int size){...}
3. Write a recursive function that reverses the elements in an array, where the array, indices of the first and the last value in the array are given as parameters.
Here is the method header: public static void reverse (int [] data, int start, int end){...}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started