Dec-03-2020, 02:44 PM
Your visualization really helped me a lot; especially with the nested calls. Thank you.
(Dec-02-2020, 06:03 PM)stranac Wrote: This is the basic structure of your function:
If we expand all calls like that, we get:
Output:rec_count(5) print 5 rec_count(4) print 5
Hope that helps.
Output:rec_count(5) print 5 rec_count(4) print 4 rec_count(3) print 3 rec_count(2) print 2 rec_count(1) print 1 rec_count(0) print 0 return 0 print 0 -- not called because the return ends this call print 1 print 2 print 3 print 4 print 5