Implement a PreOrder traversal of a tree. In this traversal the root node is visited first, then the left subtree and finally the right subtree.
Definition of a tree:
Implement function PreOrder that prints in one line the vertices of the tree in order of PreOrder traversal. Separate the vertices with one space.
During the PreOrder traversal vertices will be printed in the next order: 4 2 1 3 10 9 16.