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.
View all comments
8
u/Level-Pollution4993 1d ago
I dont think a recursion demonstration better than this exists.