{"id":2441,"date":"2022-01-27T11:12:40","date_gmt":"2022-01-27T03:12:40","guid":{"rendered":"http:\/\/139.9.1.231\/?p=2441"},"modified":"2022-01-27T11:12:40","modified_gmt":"2022-01-27T03:12:40","slug":"leetcodeday94","status":"publish","type":"post","link":"http:\/\/139.9.1.231\/index.php\/2022\/01\/27\/leetcodeday94\/","title":{"rendered":"leetcodeday94&#8211;\u4e8c\u53c9\u6811\u7684\u4e2d\u5e8f\u904d\u5386"},"content":{"rendered":"\n<p>\u7ed9\u5b9a\u4e00\u4e2a\u4e8c\u53c9\u6811\u7684\u6839\u8282\u70b9\u00a0<code>root<\/code>\u00a0\uff0c\u8fd4\u56de\u5b83\u7684\u00a0<strong>\u4e2d\u5e8f<\/strong>\u00a0\u904d\u5386\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>\u8f93\u5165\uff1a<\/strong>root = &#91;1,null,2,3]\n<strong>\u8f93\u51fa\uff1a<\/strong>&#91;1,3,2]<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code># @lc app=leetcode.cn id=94 lang=python3\r\n#\r\n# &#91;94] \u4e8c\u53c9\u6811\u7684\u4e2d\u5e8f\u904d\u5386\r\n#\r\n\r\n# @lc code=start\r\n# Definition for a binary tree node.\r\n# class TreeNode:\r\n#     def __init__(self, val=0, left=None, right=None):\r\n#         self.val = val\r\n#         self.left = left\r\n#         self.right = right\r\nclass Solution:\r\n    def inorderTraversal(self, root: Optional&#91;TreeNode]) -> List&#91;int]:\r\n        nums=&#91;]\r\n        def inorder(root):\r\n            if root==None:\r\n                return \r\n            inorder(root.left)\r\n            nums.append(root.val)\r\n            inorder(root.right)\r\n        \r\n        inorder(root)\r\n        return nums\r\n# @lc code=end<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full is-style-default\"><img loading=\"lazy\" width=\"989\" height=\"184\" src=\"http:\/\/139.9.1.231\/wp-content\/uploads\/2022\/01\/image-302.png\" alt=\"\" class=\"wp-image-2442\" srcset=\"http:\/\/139.9.1.231\/wp-content\/uploads\/2022\/01\/image-302.png 989w, http:\/\/139.9.1.231\/wp-content\/uploads\/2022\/01\/image-302-300x56.png 300w, http:\/\/139.9.1.231\/wp-content\/uploads\/2022\/01\/image-302-768x143.png 768w\" sizes=\"(max-width: 989px) 100vw, 989px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>\u7ed9\u5b9a\u4e00\u4e2a\u4e8c\u53c9\u6811\u7684\u6839\u8282\u70b9\u00a0root\u00a0\uff0c\u8fd4\u56de\u5b83\u7684\u00a0\u4e2d\u5e8f\u00a0\u904d\u5386\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[6],"tags":[],"_links":{"self":[{"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/posts\/2441"}],"collection":[{"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/comments?post=2441"}],"version-history":[{"count":3,"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/posts\/2441\/revisions"}],"predecessor-version":[{"id":2445,"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/posts\/2441\/revisions\/2445"}],"wp:attachment":[{"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/media?parent=2441"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/categories?post=2441"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/tags?post=2441"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}