Challenge: Print Post-order Traversal

Let’s print the post-order traversal of a tree.

Problem

Given a binary tree, perform a post-order traversal by completing the PrintPostOrder() function. A post-order traversal is a traversal in which a node is visited at the very end. The left child of a node is explored first, then the right child, and then the node itself.

Input

A binary tree.

Output

Display post-order traversal of the tree on the console.

Sample input

Level up your interview prep. Join Educative to access 70+ hands-on prep courses.