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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!