You must traverse all the way left before you can begin pushing onto the stack. This is best done recursively.

Note: I'm taking advantage of passing by reference here. You'll need to initialize a...