Recursive Functions in C: Factorial and Fibonacci, Revisited with Recursion Trees

Recursion — a function calling itself — was already introduced with full examples in Part 2 of the Functions series. This post revisits the two examples the syllabus specifically calls out, factorial and Fibonacci, with an added visual tool that makes recursion easier to reason about: the recursion tree. This is the final post of … Read more

Functions in C Part 2: Call by Value, Call by Reference, Scope, and Recursion

In Part 1, we covered what functions are and how to declare, define, and call them. In this post, we go deeper into how values actually travel into and out of functions, where variables “live” (scope), and one of the most powerful ideas in programming: a function calling itself, known as recursion. Call by Value: … Read more