📢 Too many exams? Don’t know which one suits you best? Book Your Free Expert 👉 call Now!

  • google app store apple app store
  • ✖

      Question

      Consider a function foo(n) that calls foo(n-1) and

      foo(n-2). This pattern of calls is best visualized using a:
      A Linear sequence Correct Answer Incorrect Answer
      B Flat list Correct Answer Incorrect Answer
      C Call tree Correct Answer Incorrect Answer
      D Hash map Correct Answer Incorrect Answer
      E Stack only Correct Answer Incorrect Answer

      Solution

      A function that makes multiple recursive calls to itself (like Fibonacci) creates a branching structure of calls. A call tree (or recursion tree) is the most appropriate way to visualize this flow, showing how each call branches into further sub-calls.

      Practice Next
      ask-question