Question: Compulsory Task 1 Follow these steps: In a file called recursion.java, create: o a recursive function that reverses a string o a recursive function that,
Compulsory Task 1 Follow these steps: In a file called recursion.java, create: o a recursive function that reverses a string o a recursive function that, given a number n, prints out the first n Fibonacci numbers (Fibonacci numbers are a sequence where each number is the sum of the previous two - 0 1 1 2 3 5 8...)
Compulsory Task 2 Follow these steps: In a file called GCDRecursion.java, create: o a recursive function to calculate the greatest common divisor (GCD) for two numbers x and y using recursion. o GCD is the largest positive integer that divides the numbers without leaving a remainder.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
