Tree/BinaryTreeNonRecursivePost.c
void postOrder(TreeNode* T) {
    TreeNode* node = T;
    StackNode* S = initStack();
    while (node || !isEmpty(S)) {
        if (node) {
            push(node, S);
            node = node -> lchild;
        }
        else {
            TreeNode* top = getTop(S) -> data;
            if (top -> rchild && top -> rchild -> flag == 0) {
                top = top -> rchild;
                push(top, S);
                node = top -> lchild;
            }
            else {
                top = pop(S) -> data;
                printf("%c ", top -> data);
                top -> flag = 1;
            }
        }
    }
}
/**
 * post order tree
 * @param T the pointer of tree root node
 */
post order tree
@param T the pointer of tree root node
post order tree @param T the pointer of tree root node
void postOrder(TreeNode* T) {
    TreeNode* node = T;
    StackNode* S = initStack();
    while (node || !isEmpty(S)) {
        if (node) {
            push(node, S);
            node = node -> lchild;
        }
        else {
            TreeNode* top = getTop(S) -> data;
            if (top -> rchild && top -> rchild -> flag == 0) {
                top = top -> rchild;
                push(top, S);
                node = top -> lchild;
            }
            else {
                top = pop(S) -> data;
                printf("%c ", top -> data);
                top -> flag = 1;
            }
        }
    }
}
void postOrder ( TreeNode * T ) { TreeNode * node = T ; StackNode * S = initStack ( ) ; while ( node || ! isEmpty ( S ) ) { if ( node ) { push ( node , S ) ; node = node -> lchild ; } else { TreeNode * top = getTop ( S ) -> data ; if ( top -> rchild && top -> rchild -> flag == 0 ) { top = top -> rchild ; push ( top , S ) ; node = top -> lchild ; } else { top = pop ( S ) -> data ; printf ( " " , top -> data ) ; top -> flag = 1 ; } } } }
post order tree
 @param T the pointer of tree root node
post order tree @param T the pointer of tree root node