{"id":124024,"date":"2026-11-08T19:40:53","date_gmt":"2026-11-08T11:40:53","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/124024.html"},"modified":"2026-11-08T19:40:53","modified_gmt":"2026-11-08T11:40:53","slug":"%e5%8f%8d%e8%bd%ac%e9%93%be%e8%a1%a8%e7%9a%84%e4%ba%94%e7%a7%8d%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/124024.html","title":{"rendered":"\u53cd\u8f6c\u94fe\u8868\u7684\u4e94\u79cd\u65b9\u6cd5"},"content":{"rendered":"<p>        \/* MD \/ \u5bcc\u6587\u672c\u4e2d\u7684 .toc\uff08\u542b\u535a\u5ba2\u56ed\u642c\u5bb6\u7b49\u5d4c\u5957\u7ed3\u6784\uff09\uff1b.toc-box \u5728\u4fa7\u680f\uff0c\u4e0d\u53d7\u5f71\u54cd *\/<br \/>\n        #content_views .toc,<br \/>\n        \/* \u7f16\u8f91\u5668\u5e38\u5728\u76ee\u5f55\u524d\u540e\u63d2\u5165\u7a7a p\uff08:empty \u4ecd\u5360 20px\uff09\uff0c\u4e00\u5e76\u53bb\u6389\u907f\u514d\u9876\u7a7a\u9699 *\/<br \/>\n        #content_views.markdown_views &gt; p:empty:has(+ .toc),<br \/>\n        #content_views.markdown_views &gt; .toc + p:empty,<br \/>\n        \/* \u5bcc\u6587\u672c\u65e7\u7248\u76ee\u5f55\u6807\u8bb0 *\/<br \/>\n        #content_views.htmledit_views #main-toc,<br \/>\n        #content_views.htmledit_views #hr-toc,<br \/>\n        #content_views.htmledit_views p[id*=\\&#8221;-toc\\&#8221;] {<br \/>\n          display: none !important;<br \/>\n        }<br \/>\n        \/* \u76ee\u5f55\u53bb\u6389\u540e\uff0c\u7d27\u8ddf\u7684\u9996\u4e2a\u6807\u9898\u4e0d\u518d\u591a\u51fa\u4e00\u5757\u4e0a\u8fb9\u8ddd *\/<br \/>\n        #content_views.markdown_views &gt; .toc + h1,<br \/>\n        #content_views.markdown_views &gt; .toc + h2,<br \/>\n        #content_views.markdown_views &gt; .toc + h3,<br \/>\n        #content_views.markdown_views &gt; .toc + h4,<br \/>\n        #content_views.markdown_views &gt; .toc + p:empty + h1,<br \/>\n        #content_views.markdown_views &gt; .toc + p:empty + h2,<br \/>\n        #content_views.markdown_views &gt; .toc + p:empty + h3,<br \/>\n        #content_views.markdown_views &gt; .toc + p:empty + h4 {<br \/>\n          margin-top: 0 !important;<br \/>\n        }<\/p>\n<h2>\u53cd\u8f6c\u94fe\u8868\u7684\u4e94\u79cd\u65b9\u6cd5<\/h2>\n<p>\u53cd\u8f6c\u94fe\u8868<\/p>\n<li>\n<p>\u53cc\u6307\u9488\u6cd5&#xff08;\u8fed\u4ee3&#xff09;<\/p>\n<p>\u8ba9\u524d\u4e00\u4e2a\u6307\u9488\u6bd4\u540e\u4e00\u4e2a\u6307\u9488\u591a\u8d70\u4e00\u6b65&#xff0c;\u7136\u540e\u8ba9\u540e\u4e00\u4e2a\u7684\u4e0b\u4e00\u4e2a\u4fdd\u5b58\u4e0b\u6765&#xff0c;\u6539\u53d8\u6307\u9488\u65b9\u5411&#xff0c;\u7136\u540e\u8ba9\u4e24\u4e2a\u6307\u9488\u5411\u540e\u8d70\u4fbf\u53ef\u3002<\/p>\n<p> <span class=\"token comment\">\/**<br \/>\n * Definition for singly-linked list.<br \/>\n * struct ListNode {<br \/>\n *     int val;<br \/>\n *     struct ListNode *next;<br \/>\n * };<br \/>\n *\/<\/span><br \/>\n<span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">ListNode<\/span><span class=\"token operator\">*<\/span> <span class=\"token function\">reverseList<\/span><span class=\"token punctuation\">(<\/span><span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">ListNode<\/span><span class=\"token operator\">*<\/span> head<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">ListNode<\/span> <span class=\"token operator\">*<\/span>pre <span class=\"token operator\">&#061;<\/span> <span class=\"token constant\">NULL<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">ListNode<\/span> <span class=\"token operator\">*<\/span>cur <span class=\"token operator\">&#061;<\/span> head<span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">while<\/span> <span class=\"token punctuation\">(<\/span>cur<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">ListNode<\/span> <span class=\"token operator\">*<\/span>temp <span class=\"token operator\">&#061;<\/span> cur<span class=\"token operator\">-&gt;<\/span>next<span class=\"token punctuation\">;<\/span><br \/>\n        cur<span class=\"token operator\">-&gt;<\/span>next <span class=\"token operator\">&#061;<\/span> pre<span class=\"token punctuation\">;<\/span><br \/>\n        pre <span class=\"token operator\">&#061;<\/span> cur<span class=\"token punctuation\">;<\/span><br \/>\n        cur <span class=\"token operator\">&#061;<\/span> temp<span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token keyword\">return<\/span> pre<span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span>\n <\/li>\n<li>\n<p>\u9012\u5f52\u6cd5<\/p>\n<p>\u5728\u9012\u7684\u8fc7\u7a0b\u5148\u5c06\u5934\u8282\u70b9\u4e00\u76f4\u5f80\u540e\u7ed9&#xff0c;\u76f4\u5230\u4e0b\u4e00\u4e2a\u8282\u70b9\u4e3a\u7a7a&#xff0c;\u6b64\u65f6\u5c06\u6700\u540e\u4e00\u4e2a\u8282\u70b9\u5f53\u4f5c\u4e86\u65b0\u94fe\u8868\u7684\u5934\u8282\u70b9&#xff0c;\u7136\u540e\u5f00\u59cb\u5f52&#xff0c;\u5148\u5c06\u6b64\u65f6\u7684\u8282\u70b9\u7684\u4e0b\u4e00\u4e2a\u4fdd\u5b58\u4f4f&#xff0c;\u7136\u540e\u8ba9\u4e0b\u4e00\u4e2a\u8282\u70b9\u7684\u4e0b\u4e00\u4e2a\u662f\u8fd9\u4e2a\u8282\u70b9&#xff0c;\u4e5f\u5c31\u662f\u6b64\u65f6\u7684head&#xff0c;\u6700\u540e\u8fd4\u56de\u65b0\u7684\u5934\u8282\u70b9\u4fbf\u53ef\u3002<\/p>\n<p>\u6ce8\u610f\\\\,&#xff1a;\u5728\u5f52\u7684\u8fc7\u7a0b&#xff0c;\u9700\u8981\u5728\u6539\u53d8\u5b8c\u8282\u70b9\u65b9\u5411\u65f6&#xff0c;\u9700\u8981\u5c06head\u7684\u4e0b\u4e00\u4e2a\u65b9\u6210\u7a7a&#xff0c;\u5426\u5219\u6210\u73af&#xff0c;\u8d85\u51fa\u65f6\u95f4\u9650\u5236\u3002<\/p>\n<\/li>\n<p><span class=\"token comment\">\/**<br \/>\n * Definition for singly-linked list.<br \/>\n * struct ListNode {<br \/>\n *     int val;<br \/>\n *     struct ListNode *next;<br \/>\n * };<br \/>\n *\/<\/span><br \/>\n<span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">ListNode<\/span><span class=\"token operator\">*<\/span> <span class=\"token function\">reverseList<\/span><span class=\"token punctuation\">(<\/span><span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">ListNode<\/span><span class=\"token operator\">*<\/span> head<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>head <span class=\"token operator\">&#061;&#061;<\/span> <span class=\"token constant\">NULL<\/span> <span class=\"token operator\">||<\/span> head<span class=\"token operator\">-&gt;<\/span>next <span class=\"token operator\">&#061;&#061;<\/span> <span class=\"token constant\">NULL<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token keyword\">return<\/span> head<span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">ListNode<\/span> <span class=\"token operator\">*<\/span>re_head <span class=\"token operator\">&#061;<\/span> <span class=\"token function\">reverseList<\/span><span class=\"token punctuation\">(<\/span>head<span class=\"token operator\">-&gt;<\/span>next<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">ListNode<\/span> <span class=\"token operator\">*<\/span>temp <span class=\"token operator\">&#061;<\/span> head<span class=\"token operator\">-&gt;<\/span>next<span class=\"token punctuation\">;<\/span><br \/>\n    temp<span class=\"token operator\">-&gt;<\/span>next <span class=\"token operator\">&#061;<\/span> head<span class=\"token punctuation\">;<\/span><br \/>\n    head<span class=\"token operator\">-&gt;<\/span>next <span class=\"token operator\">&#061;<\/span> <span class=\"token constant\">NULL<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">return<\/span> re_head<span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<li>\n<p>\u865a\u62df\u5934\u8282\u70b9<\/p>\n<p>\u903b\u8f91\u4e0a&#xff0c;\u6211\u5c06\u6b64\u6cd5\u770b\u4f5c\u4e3a\u8fed\u4ee3\u53cc\u6307\u9488&#xff0c;\u4f46\u662f\u6b64\u5904\u7684\u865a\u62df\u5934\u8282\u70b9\u662f\u672c\u8d28\u5b58\u5728\u7684&#xff0c;\u800c\u4e14\u662f\u4e0d\u53d8\u7684&#xff0c;\u53d8\u7684\u662fdummy-&gt;next&#xff0c;\u6b64\u5904\u53ef\u4ee5\u7701\u7565\u5934\u8282\u70b9\u4e3aNULL\u7684\u60c5\u51b5<\/p>\n<p> <span class=\"token comment\">\/**<br \/>\n * Definition for singly-linked list.<br \/>\n * struct ListNode {<br \/>\n *     int val;<br \/>\n *     struct ListNode *next;<br \/>\n * };<br \/>\n *\/<\/span><br \/>\n<span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">ListNode<\/span><span class=\"token operator\">*<\/span> <span class=\"token function\">reverseList<\/span><span class=\"token punctuation\">(<\/span><span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">ListNode<\/span><span class=\"token operator\">*<\/span> head<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">ListNode<\/span> <span class=\"token operator\">*<\/span>dummy <span class=\"token operator\">&#061;<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">ListNode<\/span> <span class=\"token operator\">*<\/span><span class=\"token punctuation\">)<\/span><span class=\"token function\">malloc<\/span><span class=\"token punctuation\">(<\/span><span class=\"token keyword\">sizeof<\/span><span class=\"token punctuation\">(<\/span><span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">ListNode<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    dummy<span class=\"token operator\">-&gt;<\/span>next <span class=\"token operator\">&#061;<\/span> <span class=\"token constant\">NULL<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">ListNode<\/span> <span class=\"token operator\">*<\/span>cur <span class=\"token operator\">&#061;<\/span> head<span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">while<\/span> <span class=\"token punctuation\">(<\/span>cur<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">ListNode<\/span> <span class=\"token operator\">*<\/span>nex <span class=\"token operator\">&#061;<\/span> cur<span class=\"token operator\">-&gt;<\/span>next<span class=\"token punctuation\">;<\/span><br \/>\n        cur<span class=\"token operator\">-&gt;<\/span>next <span class=\"token operator\">&#061;<\/span> dummy<span class=\"token operator\">-&gt;<\/span>next<span class=\"token punctuation\">;<\/span><br \/>\n        dummy<span class=\"token operator\">-&gt;<\/span>next <span class=\"token operator\">&#061;<\/span> cur<span class=\"token punctuation\">;<\/span><br \/>\n        cur <span class=\"token operator\">&#061;<\/span> nex<span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token keyword\">return<\/span> dummy<span class=\"token operator\">-&gt;<\/span>next<span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span>\n <\/li>\n<li>\n<p>\u6570\u7ec4\u2014\u5bb9\u5668<\/p>\n<p>\u8fd9\u4e2a\u53ef\u80fd\u662f\u6700\u7b28\u91cd\u7684\u65b9\u6cd5&#xff0c;\u5c31\u662f\u91cd\u65b0\u5f00\u8f9f\u4e2a\u6570\u7ec4&#xff0c;\u5148\u904d\u5386\u5b58\u4e0b\u94fe\u8868\u7684\u6570\u7ec4&#xff0c;\u7136\u540e\u518d\u5f00\u4e00\u4e2a\u94fe\u8868\u6765\u83b7\u53d6\u4fe1\u606f\u3002\u8fd9\u91cc\u8981\u6ce8\u610f\u5bf9\u5f00\u8f9f\u7684\u94fe\u8868\u8fdb\u884c\u521d\u59cb\u5316&#xff0c;\u5426\u5219\u4f1a\u6709\u4e0d\u786e\u5b9a\u7684\u503c\u51fa\u73b0\u3002<\/p>\n<p> <span class=\"token comment\">\/**<br \/>\n * Definition for singly-linked list.<br \/>\n * struct ListNode {<br \/>\n *     int val;<br \/>\n *     struct ListNode *next;<br \/>\n * };<br \/>\n *\/<\/span><br \/>\n<span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">ListNode<\/span><span class=\"token operator\">*<\/span> <span class=\"token function\">reverseList<\/span><span class=\"token punctuation\">(<\/span><span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">ListNode<\/span><span class=\"token operator\">*<\/span> head<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token keyword\">int<\/span> arr<span class=\"token punctuation\">[<\/span><span class=\"token number\">5000<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">int<\/span> n <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">ListNode<\/span><span class=\"token operator\">*<\/span> cur <span class=\"token operator\">&#061;<\/span> head<span class=\"token punctuation\">;<\/span><\/p>\n<p>    <span class=\"token keyword\">while<\/span> <span class=\"token punctuation\">(<\/span>cur<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        arr<span class=\"token punctuation\">[<\/span>n<span class=\"token punctuation\">]<\/span> <span class=\"token operator\">&#061;<\/span> cur<span class=\"token operator\">-&gt;<\/span>val<span class=\"token punctuation\">;<\/span><br \/>\n        cur <span class=\"token operator\">&#061;<\/span> cur<span class=\"token operator\">-&gt;<\/span>next<span class=\"token punctuation\">;<\/span><br \/>\n        n<span class=\"token operator\">&#043;&#043;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">ListNode<\/span><span class=\"token operator\">*<\/span> dummy <span class=\"token operator\">&#061;<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">ListNode<\/span><span class=\"token operator\">*<\/span> <span class=\"token punctuation\">)<\/span><span class=\"token function\">malloc<\/span><span class=\"token punctuation\">(<\/span><span class=\"token keyword\">sizeof<\/span><span class=\"token punctuation\">(<\/span><span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">ListNode<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    dummy<span class=\"token operator\">-&gt;<\/span>next <span class=\"token operator\">&#061;<\/span> <span class=\"token constant\">NULL<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">ListNode<\/span><span class=\"token operator\">*<\/span> temp <span class=\"token operator\">&#061;<\/span> dummy<span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">while<\/span> <span class=\"token punctuation\">(<\/span>n<span class=\"token operator\">&#8212;<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">ListNode<\/span><span class=\"token operator\">*<\/span> new <span class=\"token operator\">&#061;<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">ListNode<\/span><span class=\"token operator\">*<\/span> <span class=\"token punctuation\">)<\/span><span class=\"token function\">malloc<\/span><span class=\"token punctuation\">(<\/span><span class=\"token keyword\">sizeof<\/span><span class=\"token punctuation\">(<\/span><span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">ListNode<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        new<span class=\"token operator\">-&gt;<\/span>val <span class=\"token operator\">&#061;<\/span> arr<span class=\"token punctuation\">[<\/span>n<span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        new<span class=\"token operator\">-&gt;<\/span>next <span class=\"token operator\">&#061;<\/span> <span class=\"token constant\">NULL<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        temp<span class=\"token operator\">-&gt;<\/span>next <span class=\"token operator\">&#061;<\/span> new<span class=\"token punctuation\">;<\/span><br \/>\n        temp <span class=\"token operator\">&#061;<\/span> new<span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token keyword\">return<\/span> dummy<span class=\"token operator\">-&gt;<\/span>next<span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span>\n <\/li>\n<li>\n<p>\u5c3e\u9012\u5f52<\/p>\n<p>\u4e3b\u8981\u8fd8\u662f\u91c7\u7528\u9012\u5f52\u7684\u601d\u60f3&#xff0c;\u518d\u8bbe\u7f6e\u4e00\u4e2a\u51fd\u6570&#xff0c;\u540c\u65f6\u91c7\u7528\u53cc\u6307\u9488&#xff0c;\u7528\u9012\u5f52\u66ff\u4ee3\u8d4b\u503c\u7684\u601d\u60f3\u3002<\/p>\n<p> <span class=\"token comment\">\/**<br \/>\n * Definition for singly-linked list.<br \/>\n * struct ListNode {<br \/>\n *     int val;<br \/>\n *     struct ListNode *next;<br \/>\n * };<br \/>\n *\/<\/span><br \/>\n <span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">ListNode<\/span><span class=\"token operator\">*<\/span> <span class=\"token function\">tool<\/span><span class=\"token punctuation\">(<\/span><span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">ListNode<\/span><span class=\"token operator\">*<\/span> pre<span class=\"token punctuation\">,<\/span> <span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">ListNode<\/span><span class=\"token operator\">*<\/span> cur<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>cur <span class=\"token operator\">&#061;&#061;<\/span> <span class=\"token constant\">NULL<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token keyword\">return<\/span> pre<span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">ListNode<\/span><span class=\"token operator\">*<\/span> nex <span class=\"token operator\">&#061;<\/span> cur<span class=\"token operator\">-&gt;<\/span>next<span class=\"token punctuation\">;<\/span><br \/>\n    cur<span class=\"token operator\">-&gt;<\/span>next <span class=\"token operator\">&#061;<\/span> pre<span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">return<\/span> <span class=\"token function\">tool<\/span><span class=\"token punctuation\">(<\/span>cur<span class=\"token punctuation\">,<\/span> nex<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">ListNode<\/span><span class=\"token operator\">*<\/span> <span class=\"token function\">reverseList<\/span><span class=\"token punctuation\">(<\/span><span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">ListNode<\/span><span class=\"token operator\">*<\/span> head<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token keyword\">return<\/span> <span class=\"token function\">tool<\/span><span class=\"token punctuation\">(<\/span><span class=\"token constant\">NULL<\/span><span class=\"token punctuation\">,<\/span> head<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span>\n <\/li>\n","protected":false},"excerpt":{"rendered":"<p>\/* MD \/ \u5bcc\u6587\u672c\u4e2d\u7684 .toc\uff08\u542b\u535a\u5ba2\u56ed\u642c\u5bb6\u7b49\u5d4c\u5957\u7ed3\u6784\uff09\uff1b.toc-box \u5728\u4fa7\u680f\uff0c\u4e0d\u53d7\u5f71\u54cd *\/#content_views .toc,\/* \u7f16\u8f91\u5668\u5e38\u5728\u76ee\u5f55\u524d\u540e\u63d2\u5165\u7a7a p\uff08:empty \u4ecd\u5360 20px\uff09\uff0c\u4e00\u5e76\u53bb\u6389\u907f\u514d\u9876\u7a7a\u9699 *\/#content_views.markdown_views &gt; p:empty:has(+ .toc),#content_views.markdown_views &gt; .toc + p:empty,\/* \u5bcc\u6587\u672c\u65e7\u7248\u76ee\u5f55\u6807\u8bb0 *\/#content<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[1813,2640],"topic":[],"class_list":["post-124024","post","type-post","status-publish","format-standard","hentry","category-server","tag-1813","tag-2640"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u53cd\u8f6c\u94fe\u8868\u7684\u4e94\u79cd\u65b9\u6cd5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/124024.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u53cd\u8f6c\u94fe\u8868\u7684\u4e94\u79cd\u65b9\u6cd5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\/* MD \/ \u5bcc\u6587\u672c\u4e2d\u7684 .toc\uff08\u542b\u535a\u5ba2\u56ed\u642c\u5bb6\u7b49\u5d4c\u5957\u7ed3\u6784\uff09\uff1b.toc-box \u5728\u4fa7\u680f\uff0c\u4e0d\u53d7\u5f71\u54cd *\/#content_views .toc,\/* \u7f16\u8f91\u5668\u5e38\u5728\u76ee\u5f55\u524d\u540e\u63d2\u5165\u7a7a p\uff08:empty \u4ecd\u5360 20px\uff09\uff0c\u4e00\u5e76\u53bb\u6389\u907f\u514d\u9876\u7a7a\u9699 *\/#content_views.markdown_views &gt; p:empty:has(+ .toc),#content_views.markdown_views &gt; .toc + p:empty,\/* \u5bcc\u6587\u672c\u65e7\u7248\u76ee\u5f55\u6807\u8bb0 *\/#content\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/124024.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-11-08T11:40:53+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/124024.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/124024.html\",\"name\":\"\u53cd\u8f6c\u94fe\u8868\u7684\u4e94\u79cd\u65b9\u6cd5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-11-08T11:40:53+00:00\",\"dateModified\":\"2026-11-08T11:40:53+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/124024.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/124024.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/124024.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u53cd\u8f6c\u94fe\u8868\u7684\u4e94\u79cd\u65b9\u6cd5\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u53cd\u8f6c\u94fe\u8868\u7684\u4e94\u79cd\u65b9\u6cd5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/124024.html","og_locale":"zh_CN","og_type":"article","og_title":"\u53cd\u8f6c\u94fe\u8868\u7684\u4e94\u79cd\u65b9\u6cd5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\/* MD \/ \u5bcc\u6587\u672c\u4e2d\u7684 .toc\uff08\u542b\u535a\u5ba2\u56ed\u642c\u5bb6\u7b49\u5d4c\u5957\u7ed3\u6784\uff09\uff1b.toc-box \u5728\u4fa7\u680f\uff0c\u4e0d\u53d7\u5f71\u54cd *\/#content_views .toc,\/* \u7f16\u8f91\u5668\u5e38\u5728\u76ee\u5f55\u524d\u540e\u63d2\u5165\u7a7a p\uff08:empty \u4ecd\u5360 20px\uff09\uff0c\u4e00\u5e76\u53bb\u6389\u907f\u514d\u9876\u7a7a\u9699 *\/#content_views.markdown_views &gt; p:empty:has(+ .toc),#content_views.markdown_views &gt; .toc + p:empty,\/* \u5bcc\u6587\u672c\u65e7\u7248\u76ee\u5f55\u6807\u8bb0 *\/#content","og_url":"https:\/\/www.wsisp.com\/helps\/124024.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-11-08T11:40:53+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/124024.html","url":"https:\/\/www.wsisp.com\/helps\/124024.html","name":"\u53cd\u8f6c\u94fe\u8868\u7684\u4e94\u79cd\u65b9\u6cd5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-11-08T11:40:53+00:00","dateModified":"2026-11-08T11:40:53+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/124024.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/124024.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/124024.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u53cd\u8f6c\u94fe\u8868\u7684\u4e94\u79cd\u65b9\u6cd5"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/124024","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=124024"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/124024\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=124024"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=124024"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=124024"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=124024"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}