We use a stack instead, it’s not terribly different from the recursion but it saves function calls which use a lot more stack than needed.
4.1 KiB
4.1 KiB
We use a stack instead, it’s not terribly different from the recursion but it saves function calls which use a lot more stack than needed.