Medium Accuracy: 49.14% Submissions: 16874 Points: 4
Given an array arr of N nodes representing preorder traversal of BST. The task is to print its postorder traversal.
The first line of input contains an integer T denoting the number of test cases. The first line of each test case is N, the size of array. The second line of each test case contains N input as arr[i].
Postorder traversal of the given preorder traversal is printed.