added solution of preorder_tree_traversal