Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Advanced Programming Language Concepts (CT006-3-3) Recursion

Tutorial -6
Question:
1. Compare and contrast between iterative and recursive approaches in problem solving.

2. Write Java/Javascript code for the following requirements using iterative and recursive
approach.
a. the Fibonacci number ie., 0,1,1,2,3,5,8,13…
b. the Factorial number

3. Write a countdown(n) method using recursion concept that decrement the given number
by 1 with an interval of one second. Display each number until zero(0) reached.
Sample output:
5
4
3
2
1
Timeout!

4. Given a numeric array [2,3,1,48,6,3,8,9]. Write a recursion method to find a maximum


number.

5.

Level 3 Asia Pacific University of Technology and Innovation Page 1 of 1


Advanced Programming Language Concepts (CT006-3-3) Recursion

Level 3 Asia Pacific University of Technology and Innovation Page 2 of 1

You might also like