Postorder traversal from given Inorder and Preorder traversals
Easy Accuracy: 55.96% Submissions: 4378 Points: 2
Given a preOrder and inOrder traversal of a binary tree your task is to print the postOrder traversal of the tree .You are required to complete the function printPostOrderwhich prints the node of the tree in post order fashion .You should not read any input from stdin/console. There are multiple test cases. For each test case, this method will be called individually.
The task is to complete the function printPostOrder which takes 3 argument, the first being the array of inOrder Traversal of the tree (in) , the second beeing the preOrder traversal of the tree (pre) and third being the no of nodes of the Tree (N).
There are multiple test cases. For each test case, this method will be called individually.
The function should print the PostOrder traversal of the binary tree separated by space.
Your Task: Complete the function printPostOrder.
1 <=T<= 30
1 <=Number of nodes<= 100
1 <=Data of a node<= 1000
Note: The Input/Ouput format and Example given are used for system's internal purpose, and should be used by a user for Expected Output only. As it is a function problem, hence a user should not read any input from stdin/console. The task is to complete the function specified, and not to write the full code.