Print the perimeter of a given binary search tree in clockwise direction.
For e.g. in the above case the output should be: 8 10 14 13 7 4 1 3
INPUT First line of the input contains N ( no of nodes in the tree). Second line contains N space separated integers representing the nodes in the binary search tree.
OUTPUT Print the perimeter of a given binary search tree in clockwise direction. Separate each number by a space. See sample input output for more clarity