When popping an element from the stack, check whether the right child node of the element and the top element of the stack are the same. If they are the same, it means that the traversal of the left and right subtrees has been completed. At this time, you only need to pop the top element of the stack. Once and output