S
._inorder_left
that adds all the nodes in the leftmost branch of the tree rooted at a given node to the stack._inorder_left
with the root node to start the inorder traversal.hasNext()
to return True
if the stack is not empty, indicating that there are more elements to traverse.next()
to pop the top element from the stack, which is the next smallest element, and return its value. If the popped node has a right child, call _inorder_left
with the right child to add the next set of nodes to the stack.