Skip to content

Computer Science · Class 12 · ISC

Recursion

Recursive definitions, the base case, the recursive case, and recursion versus iteration.

6questions

Board PYQs
0
Practice
6
Topics
0
  • Most common: 3 marks

Syllabus mapping: ISC syllabus (CISCE) (opens CISCE's website in a new tab)

6 questions

  • Practice question

    3 marks

    Write a recursive Java method to reverse a string.

    RecursionMediumApplication based

  • Practice question

    3 marks

    Write a recursive Java method to find the greatest common divisor of two positive integers.

    RecursionMediumApplication based

  • Practice question

    3 marks

    How many times is the method called in total when fact(5) is executed, taking fact(0) as the base case?

    RecursionMediumNumerical

  • Practice question

    3 marks

    State two advantages and two disadvantages of recursion compared with iteration.

    RecursionMediumShort answer

  • Practice question

    3 marks

    Write a recursive Java method to compute the factorial of a non-negative integer n.

    RecursionMediumApplication based

  • Practice question

    3 marks

    Write a recursive Java method to compute the nth term of the Fibonacci sequence, taking the first two terms as 0 and 1.

    RecursionMediumApplication based