Write a function to print spiral order traversal of a tree.