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 deep into how values actually travel into and out of functions, what pointers are and how they enable call by reference, where variables “live” (scope), and one of the most important ideas in programming: … Read more