As already mentioned here, this is possible, but not without a parent pointer. The source pointer basically lets you navigate the "path" if you want, and therefore print the nodes. But why does recursion work without a parent pointer? Well, if you understand recursion, it looks something like this (imagine a recursion stack):
recursion
So, when the recursion ends, you printed the selected side of the binary tree in reverse order.
source share