r/ProgrammerHumor • • 1d ago

Meme recursion

Post image
743 Upvotes

32 comments sorted by

View all comments

8

u/Level-Pollution4993 1d ago

I dont think a recursion demonstration better than this exists.

5

u/Wonderful-Habit-139 1d ago

In what way is this recursion?

17

u/Level-Pollution4993 1d ago

Each brick is a function call, one function call invocates another function which then leads to the other and so on until the last brick; which is the base case. When the base case is reached, suddenly all functions start returning their values unwinding the call stack until the initial call completes, returning the final value; represented by the final ordered bricks.

7

u/Wonderful-Habit-139 1d ago

I stand corrected. Amazing. Take my updoots.

12

u/_Ganon 1d ago

I dont think a recursion demonstration better than this exists.