{"id":119,"date":"2024-12-02T23:33:18","date_gmt":"2024-12-02T15:33:18","guid":{"rendered":"http:\/\/yangnanbei.top\/?p=119"},"modified":"2025-07-26T23:48:20","modified_gmt":"2025-07-26T15:48:20","slug":"%e5%b1%82%e5%ba%8f%e9%81%8d%e5%8e%86%e7%9a%84%e4%b8%80%e7%b1%bb%e9%a2%98","status":"publish","type":"post","link":"http:\/\/yangnanbei.top\/index.php\/2024\/12\/02\/%e5%b1%82%e5%ba%8f%e9%81%8d%e5%8e%86%e7%9a%84%e4%b8%80%e7%b1%bb%e9%a2%98\/","title":{"rendered":"\u5c42\u5e8f\u904d\u5386\u7684\u4e00\u7c7b\u9898"},"content":{"rendered":"\n<p>\u4e8c\u53c9\u6811\u7684\u5c42\u5e8f\u904d\u5386\u5f80\u5f80\u7528\u5728\u6c42\u6811\u5bbd\uff0c\u6c42\u6811\u6df1\u7684\u4e00\u7c7b\u9898\u4e2d\u4f1a\u9891\u7e41\u7528\u5230\u3002<\/p>\n\n\n\n<p>\u601d\u60f3\uff1a\u4f7f\u7528\u4e00\u4e2a\u961f\u5217\uff0c\u51fa\u961f\u7684\u540c\u65f6\u5c06\u8282\u70b9\u7684\u5de6\u53f3\u5b69\u5b50\u90fd\u5165\u961f\u5373\u53ef<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u6ce8\u610f\u904d\u5386\u65f6\u5148\u53d6\u51fa\u4e00\u5c42\u7684size\uff0c\u5426\u5219\u968f\u7740\u5de6\u53f3\u5b69\u5b50\u5165\u961f\uff0c\u5176size\u4f1a\u52a8\u6001\u53d8\u5316<\/li>\n<\/ul>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#d8dee9ff;display:none\" aria-label=\"\u590d\u5236\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>class Solution {\npublic:\n    vector&lt;vector&lt;int>> levelOrder(TreeNode* &lt;em>root&lt;\/em>) {\n        &lt;em>if&lt;\/em> (!root)\n            &lt;em>return&lt;\/em> {};\n        vector&lt;vector&lt;int>> res;\n        int size;\n        queue&lt;TreeNode*> que;\n        que.push(root);\n        &lt;em>while&lt;\/em> (!que.empty()) {\n            vector&lt;int> cur_res;\n            size = que.size();\n            &lt;em>for&lt;\/em> (int i = 0; i &lt; size; i++) {\n                TreeNode* cur = que.front();\n                que.pop();\n                cur_res.push_back(cur->val);\n                &lt;em>if&lt;\/em> (cur->left) que.push(cur->left);\n                &lt;em>if&lt;\/em> (cur->right) que.push(cur->right);\n            }\n            res.push_back(cur_res);\n        }\n        &lt;em>return&lt;\/em> res;\n    }\n};<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #81A1C1\">class<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">Solution<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">public<\/span><span style=\"color: #81A1C1\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    vector<\/span><span style=\"color: #ECEFF4\">&lt;<\/span><span style=\"color: #D8DEE9FF\">vector<\/span><span style=\"color: #ECEFF4\">&lt;<\/span><span style=\"color: #D8DEE9FF\">int<\/span><span style=\"color: #ECEFF4\">&gt;&gt;<\/span><span style=\"color: #D8DEE9FF\"> levelOrder(TreeNode* <\/span><span style=\"color: #ECEFF4\">&lt;<\/span><span style=\"color: #D8DEE9FF\">em<\/span><span style=\"color: #ECEFF4\">&gt;<\/span><span style=\"color: #D8DEE9FF\">root<\/span><span style=\"color: #ECEFF4\">&lt;<\/span><span style=\"color: #D8DEE9FF\">\/em<\/span><span style=\"color: #ECEFF4\">&gt;<\/span><span style=\"color: #D8DEE9FF\">) {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #81A1C1\">&lt;em&gt;<\/span><span style=\"color: #D8DEE9FF\">if<\/span><span style=\"color: #81A1C1\">&lt;\/em&gt;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #D8DEE9FF\">!<\/span><span style=\"color: #D8DEE9\">root<\/span><span style=\"color: #ECEFF4\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">            <\/span><span style=\"color: #81A1C1\">&lt;em&gt;<\/span><span style=\"color: #D8DEE9FF\">return<\/span><span style=\"color: #81A1C1\">&lt;\/em&gt;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">{}<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #D8DEE9\">vector<\/span><span style=\"color: #81A1C1\">&lt;<\/span><span style=\"color: #D8DEE9\">vector<\/span><span style=\"color: #81A1C1\">&lt;<\/span><span style=\"color: #D8DEE9\">int<\/span><span style=\"color: #81A1C1\">&gt;&gt;<\/span><span style=\"color: #D8DEE9FF\"> res<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #D8DEE9\">int<\/span><span style=\"color: #D8DEE9FF\"> size<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #D8DEE9\">queue<\/span><span style=\"color: #81A1C1\">&lt;<\/span><span style=\"color: #D8DEE9\">TreeNode<\/span><span style=\"color: #81A1C1\">*&gt;<\/span><span style=\"color: #D8DEE9FF\"> que<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #D8DEE9\">que<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">push<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #D8DEE9\">root<\/span><span style=\"color: #D8DEE9FF\">)<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #81A1C1\">&lt;em&gt;<\/span><span style=\"color: #D8DEE9FF\">while<\/span><span style=\"color: #81A1C1\">&lt;\/em&gt;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #D8DEE9FF\">!que.empty(<\/span><span style=\"color: #ECEFF4\">)<\/span><span style=\"color: #D8DEE9FF\">) <\/span><span style=\"color: #ECEFF4\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">            <\/span><span style=\"color: #D8DEE9\">vector<\/span><span style=\"color: #81A1C1\">&lt;<\/span><span style=\"color: #D8DEE9\">int<\/span><span style=\"color: #81A1C1\">&gt;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">cur_res<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">            <\/span><span style=\"color: #D8DEE9\">size<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">que<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">size<\/span><span style=\"color: #D8DEE9FF\">()<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">            <\/span><span style=\"color: #81A1C1\">&lt;em&gt;<\/span><span style=\"color: #D8DEE9FF\">for<\/span><span style=\"color: #81A1C1\">&lt;\/em&gt;<\/span><span style=\"color: #D8DEE9FF\"> (<\/span><span style=\"color: #D8DEE9\">int<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">i<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">0<\/span><span style=\"color: #D8DEE9FF\">; <\/span><span style=\"color: #D8DEE9\">i<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">&lt;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">size<\/span><span style=\"color: #D8DEE9FF\">; <\/span><span style=\"color: #D8DEE9\">i<\/span><span style=\"color: #81A1C1\">++<\/span><span style=\"color: #D8DEE9FF\">) <\/span><span style=\"color: #ECEFF4\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">                <\/span><span style=\"color: #D8DEE9\">TreeNode<\/span><span style=\"color: #81A1C1\">*<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">cur<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">que<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">front<\/span><span style=\"color: #D8DEE9FF\">()<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">                <\/span><span style=\"color: #D8DEE9\">que<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">pop<\/span><span style=\"color: #D8DEE9FF\">()<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">                <\/span><span style=\"color: #D8DEE9\">cur_res<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">push_back<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #D8DEE9\">cur<\/span><span style=\"color: #81A1C1\">-&gt;<\/span><span style=\"color: #D8DEE9\">val<\/span><span style=\"color: #D8DEE9FF\">)<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">                <\/span><span style=\"color: #81A1C1\">&lt;em&gt;<\/span><span style=\"color: #D8DEE9FF\">if<\/span><span style=\"color: #81A1C1\">&lt;\/em&gt;<\/span><span style=\"color: #D8DEE9FF\"> (<\/span><span style=\"color: #D8DEE9\">cur<\/span><span style=\"color: #81A1C1\">-&gt;<\/span><span style=\"color: #D8DEE9\">left<\/span><span style=\"color: #D8DEE9FF\">) <\/span><span style=\"color: #D8DEE9\">que<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">push<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #D8DEE9\">cur<\/span><span style=\"color: #81A1C1\">-&gt;<\/span><span style=\"color: #D8DEE9\">left<\/span><span style=\"color: #D8DEE9FF\">)<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">                <\/span><span style=\"color: #81A1C1\">&lt;em&gt;<\/span><span style=\"color: #D8DEE9FF\">if<\/span><span style=\"color: #81A1C1\">&lt;\/em&gt;<\/span><span style=\"color: #D8DEE9FF\"> (<\/span><span style=\"color: #D8DEE9\">cur<\/span><span style=\"color: #81A1C1\">-&gt;<\/span><span style=\"color: #D8DEE9\">right<\/span><span style=\"color: #D8DEE9FF\">) <\/span><span style=\"color: #D8DEE9\">que<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">push<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #D8DEE9\">cur<\/span><span style=\"color: #81A1C1\">-&gt;<\/span><span style=\"color: #D8DEE9\">right<\/span><span style=\"color: #D8DEE9FF\">)<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">            <\/span><span style=\"color: #ECEFF4\">}<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">            <\/span><span style=\"color: #D8DEE9\">res<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">push_back<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #D8DEE9\">cur_res<\/span><span style=\"color: #D8DEE9FF\">)<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #ECEFF4\">}<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #81A1C1\">&lt;em&gt;<\/span><span style=\"color: #D8DEE9FF\">return<\/span><span style=\"color: #81A1C1\">&lt;\/em&gt;<\/span><span style=\"color: #D8DEE9FF\"> res<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #ECEFF4\">}<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">}<\/span><span style=\"color: #81A1C1\">;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>\u76f8\u5173\u9898\u76ee\uff1a<\/p>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li><a href=\"https:\/\/leetcode.cn\/problems\/binary-tree-level-order-traversal\/description\/\">102. \u4e8c\u53c9\u6811\u7684\u5c42\u5e8f\u904d\u5386 &#8211; \u529b\u6263\uff08LeetCode\uff09<\/a>\n<ul class=\"wp-block-list\">\n<li>\u6a21\u677f\u6bcd\u4f53<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><a href=\"https:\/\/leetcode.cn\/problems\/binary-tree-level-order-traversal-ii\/description\/\">107. \u4e8c\u53c9\u6811\u7684\u5c42\u5e8f\u904d\u5386 II &#8211; \u529b\u6263\uff08LeetCode\uff09<\/a>\n<ol class=\"wp-block-list\">\n<li>\u63cf\u8ff0\uff1a\u7ed9\u4f60\u4e8c\u53c9\u6811\u7684\u6839\u8282\u70b9 <code>root<\/code> \uff0c\u8fd4\u56de\u5176\u8282\u70b9\u503c <strong>\u81ea\u5e95\u5411\u4e0a\u7684\u5c42\u5e8f\u904d\u5386<\/strong> \u3002 \uff08\u5373\u6309\u4ece\u53f6\u5b50\u8282\u70b9\u6240\u5728\u5c42\u5230\u6839\u8282\u70b9\u6240\u5728\u7684\u5c42\uff0c\u9010\u5c42\u4ece\u5de6\u5411\u53f3\u904d\u5386\uff09<\/li>\n\n\n\n<li>\u601d\u8def\uff1a\u5c42\u5e8f\u904d\u5386 + reverse\n<ul class=\"wp-block-list\">\n<li>std::reverse(res.begin(), res.end());<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<\/li>\n\n\n\n<li><a href=\"https:\/\/leetcode.cn\/problems\/maximum-depth-of-binary-tree\/description\/\">104. \u4e8c\u53c9\u6811\u7684\u6700\u5927\u6df1\u5ea6 &#8211; \u529b\u6263\uff08LeetCode\uff09<\/a>\n<ul class=\"wp-block-list\">\n<li>\u5b9e\u9645\u4e0a\u4e3ares\u8282\u70b9\u7684\u4e2a\u6570<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><a href=\"https:\/\/leetcode.cn\/problems\/minimum-depth-of-binary-tree\/description\/\">111. \u4e8c\u53c9\u6811\u7684\u6700\u5c0f\u6df1\u5ea6 &#8211; \u529b\u6263\uff08LeetCode\uff09<\/a>\n<ul class=\"wp-block-list\">\n<li>\u8fd9\u4e2a\u573a\u666f\u4e0b\u6211\u4eec\u4e0d\u9700\u8981\u7528\u5230res\uff0c\u8f6c\u800c\u7528depth\u8bb0\u5f55\u6df1\u5ea6\u3002\u6bcf\u8bb0\u5f55\u4e00\u5c42depth+1,\u82e5\u65e0\u5b69\u5b50\u5219\u8fd4\u56de\u3002<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><a href=\"https:\/\/leetcode.cn\/problems\/binary-tree-right-side-view\/description\/\">199. \u4e8c\u53c9\u6811\u7684\u53f3\u89c6\u56fe &#8211; \u529b\u6263\uff08LeetCode\uff09<\/a>\n<ul class=\"wp-block-list\">\n<li>\u53f3\u89c6\u56fe\u5b9e\u9645\u4e0a\u5c31\u662f\u5c42\u5e8f\u4fbf\u5229\u7684\u6700\u540e\u4e00\u4e2a\u5143\u7d20\uff0c\u5b9e\u9645\u4e0a\u6211\u4eec\u53ea\u9700\u8981\u8bb0\u5f55\u5faa\u73af\u4e2d\u6bcf\u4e00\u5c42\u7684last one\u5373\u53ef<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><a href=\"https:\/\/leetcode.cn\/problems\/average-of-levels-in-binary-tree\/description\/\">637. \u4e8c\u53c9\u6811\u7684\u5c42\u5e73\u5747\u503c &#8211; \u529b\u6263\uff08LeetCode\uff09<\/a>\n<ul class=\"wp-block-list\">\n<li>\u591a\u8ba1\u7b97\u4e00\u6b21\u5e73\u5747\u503c\u5373\u53ef<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><a href=\"https:\/\/leetcode.cn\/problems\/n-ary-tree-level-order-traversal\/description\/\">429. N \u53c9\u6811\u7684\u5c42\u5e8f\u904d\u5386 &#8211; \u529b\u6263\uff08LeetCode\uff09<\/a>\n<ul class=\"wp-block-list\">\n<li>\u5728\u904d\u5386\u5b69\u5b50\u7684\u65f6\u5019\u6539\u4e3a\n<ul class=\"wp-block-list\">\n<li>for(auto child: node-&gt;children) { if (child) { que.push(child); } }<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><a href=\"https:\/\/leetcode.cn\/problems\/find-largest-value-in-each-tree-row\/description\/\">515. \u5728\u6bcf\u4e2a\u6811\u884c\u4e2d\u627e\u6700\u5927\u503c &#8211; \u529b\u6263\uff08LeetCode\uff09<\/a>\n<ul class=\"wp-block-list\">\n<li>\u8bb0\u5f55\u6bcf\u4e00\u5c42\u7684\u6700\u5927\u503c<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><a href=\"https:\/\/leetcode.cn\/problems\/populating-next-right-pointers-in-each-node\/description\/\">116. \u586b\u5145\u6bcf\u4e2a\u8282\u70b9\u7684\u4e0b\u4e00\u4e2a\u53f3\u4fa7\u8282\u70b9\u6307\u9488 &#8211; \u529b\u6263\uff08LeetCode\uff09<\/a>\n<ol class=\"wp-block-list\">\n<li>\u5df2\u77e5\u5f53\u524d\u5c42\uff0c\u5c06\u5f53\u524d\u5c42\u7684\u8282\u70b9\u4e32\u4e00\u904d\u5373\u53ef<\/li>\n\n\n\n<li>\u6216\u8005\u5728\u5c42\u5e8f\u4fbf\u5229\u7684\u8fc7\u7a0b\u4e2d\u8bb0\u5f55\u4e0a\u4e00\u4e2a\u8282\u70b9\uff0c\u76f4\u63a5\u4e32\u5728\u4e00\u8d77<\/li>\n<\/ol>\n<\/li>\n\n\n\n<li><a href=\"https:\/\/leetcode.cn\/problems\/populating-next-right-pointers-in-each-node-ii\/\">117. \u586b\u5145\u6bcf\u4e2a\u8282\u70b9\u7684\u4e0b\u4e00\u4e2a\u53f3\u4fa7\u8282\u70b9\u6307\u9488 II &#8211; \u529b\u6263\uff08LeetCode\uff09<\/a>\n<ul class=\"wp-block-list\">\n<li>\u8fd9\u9053\u9898\u662f\u4e8c\u53c9\u6811\uff0c116\u7ed9\u7684\u5b8c\u7f8e\u4e8c\u53c9\u6811\uff0c\u5176\u5b9e\u6ca1\u6709\u533a\u522b<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<p>\u5c42\u5e8f\u904d\u5386\u7c7b\u9898\u76ee\u5b8c\u7ed3\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e8c\u53c9\u6811\u7684\u5c42\u5e8f\u904d\u5386\u5f80\u5f80\u7528\u5728\u6c42\u6811\u5bbd\uff0c\u6c42\u6811\u6df1\u7684\u4e00\u7c7b\u9898\u4e2d\u4f1a\u9891\u7e41\u7528\u5230\u3002 \u601d\u60f3\uff1a\u4f7f\u7528\u4e00\u4e2a\u961f\u5217\uff0c\u51fa\u961f\u7684\u540c\u65f6\u5c06\u8282\u70b9\u7684\u5de6\u53f3\u5b69\u5b50\u90fd [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":104,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22,21],"tags":[25,24,23],"class_list":["post-119","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-22","category-algorithm","tag-25","tag-24","tag-23"],"_links":{"self":[{"href":"http:\/\/yangnanbei.top\/index.php\/wp-json\/wp\/v2\/posts\/119"}],"collection":[{"href":"http:\/\/yangnanbei.top\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/yangnanbei.top\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/yangnanbei.top\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/yangnanbei.top\/index.php\/wp-json\/wp\/v2\/comments?post=119"}],"version-history":[{"count":13,"href":"http:\/\/yangnanbei.top\/index.php\/wp-json\/wp\/v2\/posts\/119\/revisions"}],"predecessor-version":[{"id":291,"href":"http:\/\/yangnanbei.top\/index.php\/wp-json\/wp\/v2\/posts\/119\/revisions\/291"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/yangnanbei.top\/index.php\/wp-json\/wp\/v2\/media\/104"}],"wp:attachment":[{"href":"http:\/\/yangnanbei.top\/index.php\/wp-json\/wp\/v2\/media?parent=119"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/yangnanbei.top\/index.php\/wp-json\/wp\/v2\/categories?post=119"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/yangnanbei.top\/index.php\/wp-json\/wp\/v2\/tags?post=119"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}