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<=