@@ -0,0 +1,1687 @@
+/**%0A * http://www.lintcode.com/zh-cn/problem/binary-tree-inorder-traversal/#%0A *%0A *%0A */%0A%0A%22%22%22%0ADefinition of TreeNode:%0Aclass TreeNode:%0A    def __init__(self, val):%0A        self.val = val%0A        self.left, self.right = None, None%0A%22%22%22%0A%0A%0Aclass Solution:%0A    %22%22%22%0A    @param root: The root of binary tree.%0A    @return: Inorder in ArrayList which contains node values.%0A    %22%22%22%0A    def inorderTraversal(self, root):%0A        # write your code here%0A        res = %5B%5D%0A        stack = %5B%5D%0A        cur = root%0A        while(cur or stack):%0A            while(cur):%0A                stack.append(cur)%0A                cur = cur.left%0A            if stack:%0A                tmp = stack.pop()%0A                res.append(tmp.val)%0A                cur = tmp.right%0A        return res%0A  %0A//////////////// c++ //////////%0A/**%0A * Definition of TreeNode:%0A * class TreeNode %7B%0A * public:%0A *     int val;%0A *     TreeNode *left, *right;%0A *     TreeNode(int val) %7B%0A *         this-%3Eval = val;%0A *         this-%3Eleft = this-%3Eright = NULL;%0A *     %7D%0A * %7D%0A */%0Aclass Solution %7B%0A    /**%0A     * @param root: The root of binary tree.%0A     * @return: Inorder in vector which contains node values.%0A     */%0Apublic:%0A    vector%3Cint%3E inorderTraversal(TreeNode *root) %7B%0A        // write your code here%0A        vector%3Cint%3E res;%0A        stack%3CTreeNode*%3E s;%0A        TreeNode* cur = root;%0A        while(cur %7C%7C !s.empty())%0A        %7B%0A            while(cur)%0A            %7B%0A                s.push(cur);%0A                cur = cur-%3Eleft;%0A            %7D%0A            if(!s.empty())%0A            %7B%0A                res.push_back(s.top()-%3Eval);%0A                cur = s.top()-%3Eright;%0A                s.pop();%0A            %7D%0A        %7D%0A        return res;%0A    %7D%0A%7D;%0A

Create lintcode_二叉树的中序遍历.py