@@ -0,0 +1,701 @@
+%22%22%22%0AGiven a binary tree, return the preorder traversal of its nodes' values.%0AFor example:%0AGiven binary tree %7B1,#,2,3%7D,%0Areturn %5B1,2,3%5D. %0A%22%22%22%0A%0Aclass TreeNode(object):%0A    def __init__(self, x):%0A         self.val = x%0A         self.left = None%0A         self.right = None%0A         %0Aclass Solution(object):%0A    def preorderTraversal(self, root):%0A        %22%22%22%0A        :type root: TreeNode%0A        :rtype: List%5Bint%5D%0A        %22%22%22%0A        preorder=%5B%5D%0A        if root:%0A            preorder.append(root.val)%0A            if root.left:%0A                preorder+=self.preorderTraversal(root.left)%0A            if root.right:%0A                preorder+=self.preorderTraversal(root.right)%0A        %0A        return preorder%0A

Create BinaryTreePreorderTraversal.py