Implement a function which when given an entry point to a tree, prints its preorder, inorder and postorder traversal.
Write a sample use of the checker function in the main function of your program. Also, specify the data structure used for the tree.
Hint: Use recursion for succinct code. For the really adventurous, try doing the same iteratively (you will need to use a stack).