Iterative Postorder

easy
1. You are given a partially written BinaryTree class.
2. You are required to complete the body of iterPostorder function. The function is expected to print Postorder of the BinaryTree(Iteratively). All elements in an order must be separated by a space.
3. Input is managed for you.
4. NOTE: 
    ->Required Time Complexity : O(n)
    ->Required Space Complexity : O(n)

Input Format

Input is managed for you

Output Format

post order (elements separated by space)

Constraints

None.

Example

Input
13
20 10 25 n n 39 n n 17 n 19 n n
Output
Postorder : 
25 39 10 19 17 20 
Previous
Inorder (morris Traversal)
Next
Diagonal Traversal Of A Bnary Tree

Related Questions