Practice question
3 marksWrite a recursive Java method to reverse a string.
RecursionMediumApplication based
Computer Science · Class 12 · ISC
Recursive definitions, the base case, the recursive case, and recursion versus iteration.
6questions
Syllabus mapping: ISC syllabus (CISCE) (opens CISCE's website in a new tab)
6 questions
Practice question
3 marksWrite a recursive Java method to reverse a string.
RecursionMediumApplication based
Practice question
3 marksWrite a recursive Java method to find the greatest common divisor of two positive integers.
RecursionMediumApplication based
Practice question
3 marksHow many times is the method called in total when fact(5) is executed, taking fact(0) as the base case?
RecursionMediumNumerical
Practice question
3 marksState two advantages and two disadvantages of recursion compared with iteration.
RecursionMediumShort answer
Practice question
3 marksWrite a recursive Java method to compute the factorial of a non-negative integer n.
RecursionMediumApplication based
Practice question
3 marksWrite a recursive Java method to compute the nth term of the Fibonacci sequence, taking the first two terms as 0 and 1.
RecursionMediumApplication based