Create tree.py

tree traversal algorithm, useful to deal with parse trees