Computer Science - Algorithms - Recursion - Recursion Tracing

8 tracing questions. Q1: factorial(5) = ? → 120. Q2: How many times is factorial() called for factorial(5)? → 5 times. Q3: def f(n): if n<=0: return 0; return f(n-1)+1. f(4)=? → 4. Q4: def f(s): if len(s)==0: return ''; return f(s[1:])+s[0]. f('abc')=? → 'cba' (reverses string). Q5: def f(n): if n<=

Edodovivmagarwal
Computer Science - Algorithms - Recursion - Recursion Tracing
Log in

Preparing your experience...

Loading scripts and resources

Comments (0)

0/5000

Comments are reviewed before appearing publicly.

About this Experience

Computer Science - Algorithms - Recursion - Recursion Tracing

vivmagarwal
vivmagarwalJan 29, 2026

Description

8 tracing questions. Q1: factorial(5) = ? → 120. Q2: How many times is factorial() called for factorial(5)? → 5 times. Q3: def f(n): if n<=0: return 0; return f(n-1)+1. f(4)=? → 4. Q4: def f(s): if len(s)==0: return ''; return f(s[1:])+s[0]. f('abc')=? → 'cba' (reverses string). Q5: def f(n): if n<=

Details

Computer ScienceAlgorithmsClass 11, AS Level, Class 11, Grade 11, DP Year 1

Engagement

14

Likes

0

Remixes

0

Comments