Question: Data Structure Lab Subject: Recursion. Lab Objectives : Use recursion method. Exercise : Write a java program that reads an integer positive number and :

Data Structure Lab

Subject: Recursion.

Lab Objectives:

Use recursion method.

Exercise:

  1. Write a java program that reads an integer positive number and :

  1. Call a method that calculates and returns the factorial of the number iteratively.
  2. Call a method that calculates and returns the factorial of the number recursively.

  1. Write a java program that reads a string from the user and :

  1. Call a method that prints the string iteratively in reverse order.
  2. Call a method that prints the string recursively in reverse order.

All in the main

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!