{"action":"closed","issue":{"url":"https://api.github.com/repos/luyunyyyyy/ToDoListForJob/issues/15","repository_url":"https://api.github.com/repos/luyunyyyyy/ToDoListForJob","labels_url":"https://api.github.com/repos/luyunyyyyy/ToDoListForJob/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/luyunyyyyy/ToDoListForJob/issues/15/comments","events_url":"https://api.github.com/repos/luyunyyyyy/ToDoListForJob/issues/15/events","html_url":"https://github.com/luyunyyyyy/ToDoListForJob/issues/15","id":331569297,"node_id":"MDU6SXNzdWUzMzE1NjkyOTc=","number":15,"title":"Sprint-1-LeetCode-Binary Tree Inorder Traversal","user":{"login":"luyunyyyyy","id":17078038,"node_id":"MDQ6VXNlcjE3MDc4MDM4","avatar_url":"https://avatars3.githubusercontent.com/u/17078038?v=4","gravatar_id":"","url":"https://api.github.com/users/luyunyyyyy","html_url":"https://github.com/luyunyyyyy","followers_url":"https://api.github.com/users/luyunyyyyy/followers","following_url":"https://api.github.com/users/luyunyyyyy/following{/other_user}","gists_url":"https://api.github.com/users/luyunyyyyy/gists{/gist_id}","starred_url":"https://api.github.com/users/luyunyyyyy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luyunyyyyy/subscriptions","organizations_url":"https://api.github.com/users/luyunyyyyy/orgs","repos_url":"https://api.github.com/users/luyunyyyyy/repos","events_url":"https://api.github.com/users/luyunyyyyy/events{/privacy}","received_events_url":"https://api.github.com/users/luyunyyyyy/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/luyunyyyyy/ToDoListForJob/milestones/1","html_url":"https://github.com/luyunyyyyy/ToDoListForJob/milestone/1","labels_url":"https://api.github.com/repos/luyunyyyyy/ToDoListForJob/milestones/1/labels","id":3415413,"node_id":"MDk6TWlsZXN0b25lMzQxNTQxMw==","number":1,"title":"第一个Sprint-启程","description":"# 主要内容\n1. 开始博客教程的写作\n2. 数据结构课程 LeetCode","creator":{"login":"luyunyyyyy","id":17078038,"node_id":"MDQ6VXNlcjE3MDc4MDM4","avatar_url":"https://avatars3.githubusercontent.com/u/17078038?v=4","gravatar_id":"","url":"https://api.github.com/users/luyunyyyyy","html_url":"https://github.com/luyunyyyyy","followers_url":"https://api.github.com/users/luyunyyyyy/followers","following_url":"https://api.github.com/users/luyunyyyyy/following{/other_user}","gists_url":"https://api.github.com/users/luyunyyyyy/gists{/gist_id}","starred_url":"https://api.github.com/users/luyunyyyyy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luyunyyyyy/subscriptions","organizations_url":"https://api.github.com/users/luyunyyyyy/orgs","repos_url":"https://api.github.com/users/luyunyyyyy/repos","events_url":"https://api.github.com/users/luyunyyyyy/events{/privacy}","received_events_url":"https://api.github.com/users/luyunyyyyy/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":2,"state":"open","created_at":"2018-06-11T11:53:28Z","updated_at":"2018-06-13T11:59:03Z","due_on":"2018-06-18T07:00:00Z","closed_at":null},"comments":1,"created_at":"2018-06-12T12:38:31Z","updated_at":"2018-06-13T11:59:02Z","closed_at":"2018-06-13T11:59:02Z","author_association":"OWNER","body":"这是一个中序遍历二叉树的题 \n就跟刚才那个一样 可以有递归和遍历两种方式\n# 递归 \n可以做一个 static 的数组, 用于保存中间变量. 然后每次递归都放到这个数组中. 需要注意到中间遇到离奇问题. 输入的空树输出却是[1,2,3] 后来看到是因为静态变量初始化写在类的属性中.每次执行测试都会在一个相同的对象中保存结果. 产生错误. 改正方法是把初始化放在方法调用的时候, 每次都执行.\n```\npublic static List<Integer> result ;\n    public List<Integer> inorderTraversal(TreeNode root) {\n        // if(root == null){\n        //     return result;\n        // }\n        result = new ArrayList<>();\n        inorder(root);\n        return result;\n    }\n    public void inorder(TreeNode root){\n        if(root == null){\n            return ;\n        }\n        if(root.left != null){\n            inorder(root.left);\n        }\n        result.add(root.val);\n        if(root.right != null){\n            inorder(root.right);\n        }\n    }\n```\n"}}
{"actor":{"display_login":"luyunyyyyy"}}