fact (N) if (N equals 0) Return 1 else Return N * fact (N − 1) The above…

2023

fact (N) if (N equals 0) Return 1 else Return N * fact (N − 1) The above algorithm is a specific example of ______.

  1. A.

    Selection

  2. B.

    Sorting

  3. C.

    Recursion

  4. D.

    Displacement

  5. E.

    Question not attempted

Attempted by 111 students.

Show answer & explanation

Correct answer: C

C. Recursion

Recursion is a programming technique where a function solves a problem by calling itself with a smaller input until a base condition is reached.

In this algorithm, fact(N) calls fact(N−1) repeatedly until N = 0, where it returns 1. This makes it a classic example of recursion.

Explore the full course: Up Lt Grade Assistant Teacher 2025