{"id":92565,"date":"2026-08-10T15:56:54","date_gmt":"2026-08-10T07:56:54","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/92565.html"},"modified":"2026-08-10T15:56:54","modified_gmt":"2026-08-10T07:56:54","slug":"%e5%8f%8c%e5%90%91%e5%be%aa%e7%8e%af%e9%93%be%e8%a1%a8%ef%bc%9a%e5%8d%95%e5%90%91%e7%9a%84%e8%bf%9b%e5%8c%96%ef%bc%8c%e6%8f%92%e5%85%a5%e5%88%a0%e9%99%a4%e7%9a%84%e7%bb%88%e6%9e%81%e5%bd%a2%e6%80%81","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/92565.html","title":{"rendered":"\u53cc\u5411\u5faa\u73af\u94fe\u8868\uff1a\u5355\u5411\u7684\u8fdb\u5316\uff0c\u63d2\u5165\u5220\u9664\u7684\u7ec8\u6781\u5f62\u6001"},"content":{"rendered":"<h2>\u53cc\u5411\u5faa\u73af\u94fe\u8868&#xff1a;\u5355\u5411\u7684\u8fdb\u5316&#xff0c;\u63d2\u5165\u5220\u9664\u7684\u7ec8\u6781\u5f62\u6001<\/h2>\n<h3>1. \u7075\u9b42\u62f7\u95ee&#xff1a;\u5355\u5411\u94fe\u8868\u4e0d\u591f\u7528\u4e86\u5417&#xff1f;<\/h3>\n<p>\u4e0a\u4e00\u7bc7\u6211\u4eec\u624b\u6495\u4e86\u5355\u5411\u94fe\u8868&#xff0c;\u5934\u63d2\u3001\u5c3e\u63d2\u3001\u67e5\u627e\u3001\u5220\u9664&#xff0c;\u6bcf\u4e2a\u64cd\u4f5c\u90fd\u5256\u6790\u5f97\u660e\u660e\u767d\u767d\u3002\u4f46\u5728\u5b9e\u9645\u52a8\u624b\u5199\u4ee3\u7801\u65f6&#xff0c;\u6211\u8e29\u5230\u4e86\u51e0\u4e2a\u75db\u5230\u523b\u9aa8\u94ed\u5fc3\u7684\u5751&#xff1a;<\/p>\n<ul>\n<li>\u5c3e\u63d2\u5fc5\u987b\u4ece\u5934\u8dd1\u5230\u5c3e&#xff1a;\u6bcf\u6b21\u60f3\u5728\u672b\u5c3e\u52a0\u4e2a\u5143\u7d20&#xff0c;\u90fd\u8981 while(cur-&gt;next) \u904d\u5386\u6574\u6761\u94fe\u8868&#xff0c;\u65f6\u95f4\u590d\u6742\u5ea6 O(n)\u3002<\/li>\n<li>\u627e\u4e0d\u5230\u524d\u9a71&#xff0c;\u5220\u9664\u592a\u75db\u82e6&#xff1a;\u8981\u5220\u9664\u67d0\u4e2a\u8282\u70b9&#xff0c;\u5fc5\u987b\u5148\u627e\u5230\u5b83\u7684\u524d\u4e00\u4e2a\u8282\u70b9&#xff0c;\u5426\u5219\u94fe\u8868\u5c31\u65ad\u4e86\u3002\u4e3a\u6b64\u6211\u8fd8\u4e13\u95e8\u5199\u4e86\u4e2a FindBefore \u51fd\u6570\u3002<\/li>\n<li>\u65e0\u6cd5\u56de\u5934&#xff1a;\u5355\u5411\u94fe\u8868\u53ea\u80fd\u4e00\u8def\u8d70\u5230\u9ed1\u3002\u60f3\u8fd4\u56de\u4e0a\u4e00\u4e2a\u8282\u70b9&#xff1f;\u5bf9\u4e0d\u8d77&#xff0c;\u8981\u4e48\u91cd\u5934\u518d\u6765&#xff0c;\u8981\u4e48\u63d0\u524d\u5b58\u597d\u6307\u9488\u3002<\/li>\n<\/ul>\n<p>\u8fd9\u4e9b\u75db\u70b9&#xff0c;\u90fd\u662f\u56e0\u4e3a\u5355\u5411\u94fe\u8868\u53ea\u6709\u4e00\u6839 next \u6307\u9488\u3002\u5982\u679c\u6bcf\u4e2a\u8282\u70b9\u9664\u4e86\u77e5\u9053&#034;\u4e0b\u4e00\u4e2a\u662f\u8c01&#034;&#xff0c;\u8fd8\u77e5\u9053&#034;\u4e0a\u4e00\u4e2a\u662f\u8c01&#034;&#xff0c;\u90a3\u4e48\u5c3e\u63d2\u4e0d\u7528\u904d\u5386\u3001\u5220\u9664\u4e0d\u7528\u627e\u524d\u9a71\u3001\u904d\u5386\u53ef\u4ee5\u53cc\u5411\u8d70\u2014\u2014\u6240\u6709\u95ee\u9898\u8fce\u5203\u800c\u89e3\u3002<\/p>\n<p>\u5982\u679c\u518d\u8fdb\u4e00\u6b65&#xff0c;\u8ba9\u5c3e\u8282\u70b9\u7684 next \u6307\u5411\u5934\u8282\u70b9&#xff0c;\u5934\u8282\u70b9\u7684 prev \u6307\u5411\u5c3e\u8282\u70b9&#xff0c;\u94fe\u8868\u5f62\u6210\u4e00\u4e2a\u95ed\u73af&#xff0c;\u90a3\u4e48\u5c3e\u8282\u70b9\u53ef\u4ee5\u901a\u8fc7 head-&gt;prev \u76f4\u63a5\u5b9a\u4f4d&#xff0c;\u8fde\u5c3e\u6307\u9488\u90fd\u4e0d\u7528\u5355\u72ec\u7ef4\u62a4\u3002\u8fd9\u5c31\u662f\u6211\u4eec\u4eca\u5929\u8981\u5b9e\u73b0\u7684\u65e0\u5934\u53cc\u5411\u5faa\u73af\u94fe\u8868&#xff0c;\u771f\u6b63\u6253\u7834\u5355\u5411\u94fe\u8868\u7684\u6027\u80fd\u74f6\u9888\u3002<\/p>\n<table>\n<tr>\u7279\u6027\u5355\u5411\u94fe\u8868\u53cc\u5411\u5faa\u73af\u94fe\u8868<\/tr>\n<tbody>\n<tr>\n<td>\u8282\u70b9\u6307\u9488<\/td>\n<td>next<\/td>\n<td>next &#043; prev<\/td>\n<\/tr>\n<tr>\n<td>\u5c3e\u63d2\u590d\u6742\u5ea6<\/td>\n<td>O(n)&#xff08;\u65e0\u5c3e\u6307\u9488&#xff09;<\/td>\n<td>O(1)<\/td>\n<\/tr>\n<tr>\n<td>\u5220\u9664\u6307\u5b9a\u8282\u70b9<\/td>\n<td>\u9700\u627e\u524d\u9a71 O(n)<\/td>\n<td>\u65e0\u9700\u524d\u9a71&#xff0c;O(1)<\/td>\n<\/tr>\n<tr>\n<td>\u5bfb\u627e\u524d\u9a71<\/td>\n<td>O(n)<\/td>\n<td>O(1)<\/td>\n<\/tr>\n<tr>\n<td>\u5c3e\u8282\u70b9\u5b9a\u4f4d<\/td>\n<td>O(n)<\/td>\n<td>O(1)&#xff1a;head-&gt;prev<\/td>\n<\/tr>\n<tr>\n<td>\u904d\u5386\u65b9\u5411<\/td>\n<td>\u53ea\u80fd\u5411\u540e<\/td>\n<td>\u524d\u540e\u5747\u53ef<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>2. \u7ed3\u6784\u8bbe\u8ba1&#xff1a;\u591a\u4e00\u6839\u6307\u9488&#xff0c;\u5c11\u65e0\u6570\u9ebb\u70e6<\/h3>\n<h4>2.1 \u8282\u70b9\u7ed3\u6784\u4f53<\/h4>\n<p><span class=\"token keyword\">typedef<\/span> <span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">_DDLinkListNode<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    DataType data<span class=\"token punctuation\">;<\/span>                    <span class=\"token comment\">\/\/ \u6570\u636e\u57df<\/span><br \/>\n    <span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">_DDLinkListNode<\/span><span class=\"token operator\">*<\/span> next<span class=\"token punctuation\">;<\/span>    <span class=\"token comment\">\/\/ \u540e\u7ee7\u6307\u9488<\/span><br \/>\n    <span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">_DDLinkListNode<\/span><span class=\"token operator\">*<\/span> prev<span class=\"token punctuation\">;<\/span>    <span class=\"token comment\">\/\/ \u524d\u9a71\u6307\u9488 \u2190 \u8fd9\u5c31\u662f\u89e3\u51b3\u6240\u6709\u75db\u70b9\u7684\u5173\u952e<\/span><br \/>\n<span class=\"token punctuation\">}<\/span> DDLinkListNode<span class=\"token punctuation\">;<\/span><\/p>\n<p>\u5bf9\u6bd4\u5355\u5411\u94fe\u8868&#xff0c;\u53ea\u662f\u591a\u4e86\u4e00\u4e2a prev \u6210\u5458\u3002\u4f46\u5728\u7b97\u6cd5\u8bbe\u8ba1\u4e0a&#xff0c;\u4e00\u4e2a prev \u6362\u6765\u4e86\u63d2\u5165\u3001\u5220\u9664\u64cd\u4f5c\u6027\u80fd\u7684\u5168\u9762\u63d0\u5347\u3002<\/p>\n<h4>2.2 \u7ba1\u7406\u7ed3\u6784\u4f53&#xff1a;\u4e3a\u4ec0\u4e48\u6211\u4e0d\u52a0 tail&#xff1f;<\/h4>\n<p><span class=\"token keyword\">typedef<\/span> <span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">_DDLinkList<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    DDLinkListNode<span class=\"token operator\">*<\/span> head<span class=\"token punctuation\">;<\/span>  <span class=\"token comment\">\/\/ \u5934\u8282\u70b9\u6307\u9488<\/span><br \/>\n    <span class=\"token keyword\">int<\/span> size<span class=\"token punctuation\">;<\/span>              <span class=\"token comment\">\/\/ \u8282\u70b9\u603b\u6570<\/span><br \/>\n<span class=\"token punctuation\">}<\/span> DDLinkList<span class=\"token punctuation\">;<\/span><\/p>\n<p>\u7ec6\u5fc3\u7684\u4f60\u53ef\u80fd\u4f1a\u95ee&#xff1a;\u201c\u65e2\u7136\u8981\u4f18\u5316\u5c3e\u63d2&#xff0c;\u4e3a\u4ec0\u4e48\u4e0d\u5b66\u5355\u5411\u94fe\u8868\u90a3\u6837&#xff0c;\u7ef4\u62a4\u4e00\u4e2a tail \u6307\u9488\u5462&#xff1f;\u201d<\/p>\n<p>\u7b54\u6848\u5c31\u5728\u5faa\u73af\u4e8c\u5b57\u4e0a\u3002\u5faa\u73af\u94fe\u8868\u4e2d&#xff0c;\u5c3e\u8282\u70b9\u7684 next \u6307\u5411\u5934\u8282\u70b9&#xff0c;\u5934\u8282\u70b9\u7684 prev \u6307\u5411\u5c3e\u8282\u70b9\u3002\u56e0\u6b64&#xff0c;\u5934\u8282\u70b9\u7684\u524d\u9a71 head-&gt;prev \u5c31\u662f\u5c3e\u8282\u70b9\u3002\u7528 head-&gt;prev \u8bbf\u95ee\u5c3e\u8282\u70b9\u7684\u65f6\u95f4\u590d\u6742\u5ea6\u540c\u6837\u662f O(1)&#xff0c;\u6211\u4f55\u5fc5\u518d\u591a\u7ef4\u62a4\u4e00\u4e2a tail&#xff0c;\u5f92\u589e\u51fa\u9519\u7684\u98ce\u9669\u5462&#xff1f;<\/p>\n<p>\u8fd9\u5c31\u662f\u7528\u7ed3\u6784\u8bbe\u8ba1\u6362\u53d6\u4ee3\u7801\u7b80\u5316\u7684\u7ecf\u5178\u6848\u4f8b\u3002<\/p>\n<h3>3. \u6240\u6709\u63d2\u5165\u64cd\u4f5c\u7684\u57fa\u77f3&#xff1a;InsertBefore<\/h3>\n<p>\u5355\u5411\u94fe\u8868\u4e2d&#xff0c;\u6211\u8bbe\u8ba1\u4e86 InsertAfter \u4f5c\u4e3a\u6838\u5fc3&#xff1b;\u800c\u53cc\u5411\u5faa\u73af\u94fe\u8868\u91cc&#xff0c;InsertBefore&#xff08;\u5728\u67d0\u4e2a\u8282\u70b9\u524d\u63d2\u5165&#xff09;\u624d\u662f\u771f\u6b63\u7684\u4e07\u80fd\u51fd\u6570\u3002\u5934\u63d2\u3001\u5c3e\u63d2\u3001\u6307\u5b9a\u4f4d\u7f6e\u524d\u63d2\u3001\u540e\u63d2&#xff0c;\u5168\u90e8\u901a\u8fc7\u5b83\u5b9e\u73b0&#xff0c;\u4e00\u5957\u56db\u6b65\u6307\u9488\u64cd\u4f5c\u5403\u904d\u5929\u3002<\/p>\n<h4>3.1 \u4ee3\u7801\u5b9e\u73b0<\/h4>\n<p><span class=\"token keyword\">static<\/span> <span class=\"token keyword\">void<\/span> <span class=\"token function\">InsertBefore<\/span><span class=\"token punctuation\">(<\/span>DDLinkList<span class=\"token operator\">*<\/span> list<span class=\"token punctuation\">,<\/span> DDLinkListNode<span class=\"token operator\">*<\/span> pos<span class=\"token punctuation\">,<\/span><br \/>\n                         DDLinkListNode<span class=\"token operator\">*<\/span> node<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token function\">assert<\/span><span class=\"token punctuation\">(<\/span>list <span class=\"token operator\">&amp;&amp;<\/span> node<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>list<span class=\"token operator\">-&gt;<\/span>head <span class=\"token operator\">&#061;&#061;<\/span> <span class=\"token constant\">NULL<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span>          <span class=\"token comment\">\/\/ \u7a7a\u94fe\u8868&#xff1a;\u81ea\u6210\u95ed\u73af<\/span><br \/>\n        node<span class=\"token operator\">-&gt;<\/span>next <span class=\"token operator\">&#061;<\/span> node<span class=\"token punctuation\">;<\/span><br \/>\n        node<span class=\"token operator\">-&gt;<\/span>prev <span class=\"token operator\">&#061;<\/span> node<span class=\"token punctuation\">;<\/span><br \/>\n        list<span class=\"token operator\">-&gt;<\/span>head <span class=\"token operator\">&#061;<\/span> node<span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">else<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token comment\">\/\/ \u56db\u6b65\u6307\u9488\u64cd\u4f5c&#xff0c;\u987a\u5e8f\u6781\u4e3a\u91cd\u8981<\/span><br \/>\n        node<span class=\"token operator\">-&gt;<\/span>prev <span class=\"token operator\">&#061;<\/span> pos<span class=\"token operator\">-&gt;<\/span>prev<span class=\"token punctuation\">;<\/span>        <span class=\"token comment\">\/\/ \u2460 \u65b0\u8282\u70b9\u8bb0\u4f4f\u524d\u9a71<\/span><br \/>\n        node<span class=\"token operator\">-&gt;<\/span>next <span class=\"token operator\">&#061;<\/span> pos<span class=\"token punctuation\">;<\/span>              <span class=\"token comment\">\/\/ \u2461 \u65b0\u8282\u70b9\u8bb0\u4f4f\u540e\u7ee7<\/span><br \/>\n        pos<span class=\"token operator\">-&gt;<\/span>prev<span class=\"token operator\">-&gt;<\/span>next <span class=\"token operator\">&#061;<\/span> node<span class=\"token punctuation\">;<\/span>        <span class=\"token comment\">\/\/ \u2462 \u524d\u9a71\u6539\u4e3a\u6307\u5411\u65b0\u8282\u70b9<\/span><br \/>\n        pos<span class=\"token operator\">-&gt;<\/span>prev <span class=\"token operator\">&#061;<\/span> node<span class=\"token punctuation\">;<\/span>              <span class=\"token comment\">\/\/ \u2463 \u540e\u7ee7&#xff08;pos&#xff09;\u7684\u524d\u9a71\u6539\u4e3a\u65b0\u8282\u70b9<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n    list<span class=\"token operator\">-&gt;<\/span>size<span class=\"token operator\">&#043;&#043;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<h4>3.2 \u56fe\u89e3\u6307\u9488\u91cd\u6392&#xff08;\u91cd\u70b9&#xff01;&#xff09;<\/h4>\n<p>\u5047\u8bbe\u539f\u94fe\u8868\u4e3a &#8230; \u21c4 A \u21c4 B \u21c4 &#8230;&#xff0c;\u73b0\u8981\u5728 B \u4e4b\u524d\u63d2\u5165 New\u3002\u64cd\u4f5c\u524d\u72b6\u6001&#xff1a;<\/p>\n<p>A \u27f7 B    (A-&gt;next &#061; B, B-&gt;prev &#061; A)<\/p>\n<p>\u6267\u884c\u56db\u6b65\u64cd\u4f5c&#xff1a;<\/p>\n<li>New-&gt;prev &#061; B-&gt;prev; \u2192 New \u6307\u5411\u524d\u9a71 A<\/li>\n<li>New-&gt;next &#061; B; \u2192 New \u6307\u5411\u540e\u7ee7 B<\/li>\n<li>B-&gt;prev-&gt;next &#061; New; \u2192 A \u7684 next \u6539\u4e3a New<\/li>\n<li>B-&gt;prev &#061; New; \u2192 B \u7684\u524d\u9a71\u6539\u4e3a New<\/li>\n<p>\u5b8c\u6210\u540e&#xff1a;<\/p>\n<p>A \u21c4 New \u21c4 B<\/p>\n<p>\u4e3a\u4ec0\u4e48\u987a\u5e8f\u4e0d\u80fd\u4e71&#xff1f;<\/p>\n<ul>\n<li>\u5fc5\u987b\u5148\u6267\u884c \u2460\u2461&#xff0c;\u8ba9\u65b0\u8282\u70b9\u5148&#034;\u8bb0\u4f4f&#034;\u81ea\u5df1\u7684\u90bb\u5c45\u3002<\/li>\n<li>\u5982\u679c\u5148\u6267\u884c \u2462\u2463&#xff0c;\u6bd4\u5982\u5148\u6539\u4e86 A-&gt;next&#xff0c;\u90a3 pos-&gt;prev \u6307\u5411\u7684 A \u5df2\u7ecf\u53d1\u751f\u4e86\u53d8\u5316&#xff0c;\u6b65\u9aa4 \u2460 \u518d\u53bb\u627e pos-&gt;prev \u62ff\u5230\u7684\u5c31\u4e0d\u662f\u539f\u6765\u7684 A \u4e86&#xff0c;\u6307\u9488\u7acb\u523b\u4e71\u5957\u3002<\/li>\n<\/ul>\n<p>\u539f\u5219\u603b\u7ed3&#xff1a;\u63d2\u5165\u65f6&#xff0c;\u5148\u5904\u7406\u65b0\u8282\u70b9\u7684\u4e24\u6761\u6307\u9488&#xff0c;\u518d\u4fee\u6539\u90bb\u5c45\u7684\u6307\u9488\u3002\u5220\u9664\u65f6\u5219\u76f8\u53cd&#xff0c;\u5148\u5904\u7406\u90bb\u5c45\u6307\u9488&#xff0c;\u518d\u91ca\u653e\u8282\u70b9\u3002<\/p>\n<h3>4. \u5934\u63d2\u4e0e\u5c3e\u63d2&#xff1a;\u4e00\u884c\u4ee3\u7801&#xff0c;O(1) \u5b8c\u6210<\/h3>\n<p>\u6709\u4e86 InsertBefore&#xff0c;\u5934\u63d2\u548c\u5c3e\u63d2\u53d8\u5f97\u6781\u5176\u7b80\u5355&#xff0c;\u4ee3\u7801\u590d\u7528\u8fbe\u5230\u6781\u81f4\u3002<\/p>\n<h4>4.1 \u5934\u63d2<\/h4>\n<p>ErrorCode <span class=\"token function\">DDLinkListPushFront<\/span><span class=\"token punctuation\">(<\/span>DDLinkList<span class=\"token operator\">*<\/span> plist<span class=\"token punctuation\">,<\/span> DataType val<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token comment\">\/\/ \u6821\u9a8c\u4e0e\u521b\u5efa\u8282\u70b9\u7701\u7565&#8230;<\/span><br \/>\n    <span class=\"token function\">InsertBefore<\/span><span class=\"token punctuation\">(<\/span>plist<span class=\"token punctuation\">,<\/span> plist<span class=\"token operator\">-&gt;<\/span>head<span class=\"token punctuation\">,<\/span> node<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    plist<span class=\"token operator\">-&gt;<\/span>head <span class=\"token operator\">&#061;<\/span> node<span class=\"token punctuation\">;<\/span>   <span class=\"token comment\">\/\/ \u2605 \u552f\u4e00\u989d\u5916\u64cd\u4f5c&#xff1a;\u66f4\u65b0\u5934\u6307\u9488<\/span><br \/>\n    <span class=\"token keyword\">return<\/span> SUCCESS<span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>\u5934\u63d2 &#061; \u5728\u5f53\u524d head \u8282\u70b9\u524d\u63d2\u5165\u65b0\u8282\u70b9&#xff0c;\u7136\u540e\u5c06 head \u6307\u5411\u65b0\u8282\u70b9\u3002InsertBefore \u5df2\u7ecf\u5b8c\u6210\u4e86\u6240\u6709\u6307\u9488\u8fde\u63a5&#xff0c;\u53ea\u9700\u518d\u632a\u4e00\u4e0b head \u5373\u53ef\u3002<\/p>\n<h4>4.2 \u5c3e\u63d2<\/h4>\n<p>ErrorCode <span class=\"token function\">DDLinkListPushBack<\/span><span class=\"token punctuation\">(<\/span>DDLinkList<span class=\"token operator\">*<\/span> plist<span class=\"token punctuation\">,<\/span> DataType val<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token comment\">\/\/ \u6821\u9a8c\u4e0e\u521b\u5efa\u8282\u70b9\u7701\u7565&#8230;<\/span><br \/>\n    <span class=\"token function\">InsertBefore<\/span><span class=\"token punctuation\">(<\/span>plist<span class=\"token punctuation\">,<\/span> plist<span class=\"token operator\">-&gt;<\/span>head<span class=\"token punctuation\">,<\/span> node<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token comment\">\/\/ \u2605 \u6ce8\u610f&#xff1a;\u8fd9\u91cc\u4e0d\u66f4\u65b0 head&#xff01;<\/span><br \/>\n    <span class=\"token keyword\">return<\/span> SUCCESS<span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>\u5c3e\u63d2 &#061; \u5728 head \u8282\u70b9\u524d\u63d2\u5165\u65b0\u8282\u70b9&#xff0c;\u4f46**\u4e0d\u79fb\u52a8 ****head**\u3002\u795e\u5947\u4e4b\u5904&#xff1a;\u7531\u4e8e\u94fe\u8868\u662f\u5faa\u73af\u7684&#xff0c;head \u7684\u524d\u4e00\u4e2a\u4f4d\u7f6e\u6070\u597d\u5c31\u662f\u5c3e\u8282\u70b9\u4e4b\u540e\u3002\u65b0\u8282\u70b9\u63d2\u5165\u5230 head \u4e4b\u524d&#xff0c;\u5c31\u6210\u4e86\u65b0\u7684\u5c3e\u8282\u70b9&#xff0c;\u800c head \u7684\u4f4d\u7f6e\u4e0d\u53d8&#xff0c;\u6574\u4e2a\u7ed3\u6784\u4fdd\u6301\u5faa\u73af\u3002\u4e0d\u9700\u8981\u904d\u5386&#xff0c;\u65f6\u95f4\u590d\u6742\u5ea6 O(1)\u3002<\/p>\n<p>\u8865\u5145\u8bf4\u660e&#xff1a;\u5f53\u94fe\u8868\u4e3a\u7a7a\u65f6&#xff08;head &#061;&#061; NULL&#xff09;&#xff0c;InsertBefore \u4f1a\u8d70\u7a7a\u94fe\u8868\u5206\u652f&#xff0c;\u5c06\u65b0\u8282\u70b9\u7684 next \u548c prev \u90fd\u6307\u5411\u81ea\u8eab&#xff0c;\u5e76\u5c06 head \u8bbe\u7f6e\u4e3a\u65b0\u8282\u70b9\u3002\u6b64\u65f6\u65b0\u8282\u70b9\u65e2\u662f\u5934\u8282\u70b9\u4e5f\u662f\u5c3e\u8282\u70b9&#xff0c;head \u88ab\u6b63\u786e\u521d\u59cb\u5316&#xff0c;\u65e0\u9700\u989d\u5916\u5904\u7406\u3002<\/p>\n<p>\u5355\u5411\u94fe\u8868\u7684\u5c3e\u63d2 O(n) \u4e4b\u75db&#xff0c;\u81f3\u6b64\u5f7b\u5e95\u89e3\u51b3\u3002<\/p>\n<h3>5. \u6307\u5b9a\u4f4d\u7f6e\u63d2\u5165&#xff1a;\u524d\u540e\u90fd\u80fd\u63d2&#xff0c;\u903b\u8f91\u7edf\u4e00<\/h3>\n<h4>5.1 \u5728 pos \u524d\u9762\u63d2\u5165<\/h4>\n<p>ErrorCode <span class=\"token function\">DDLinkListInsertFront<\/span><span class=\"token punctuation\">(<\/span>DDLinkList<span class=\"token operator\">*<\/span> plist<span class=\"token punctuation\">,<\/span> DDLinkListNode<span class=\"token operator\">*<\/span> pos<span class=\"token punctuation\">,<\/span><br \/>\n                                DataType val<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token comment\">\/\/ \u6821\u9a8c\u4e0e\u521b\u5efa\u8282\u70b9\u7701\u7565&#8230;<\/span><br \/>\n    <span class=\"token function\">InsertBefore<\/span><span class=\"token punctuation\">(<\/span>plist<span class=\"token punctuation\">,<\/span> pos<span class=\"token punctuation\">,<\/span> node<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">return<\/span> SUCCESS<span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>\u76f4\u63a5\u8c03\u7528 InsertBefore\u3002\u7531\u4e8e pos \u672c\u8eab\u5728\u94fe\u8868\u4e2d&#xff0c;\u64cd\u4f5c\u540e head \u4ecd\u7136\u6709\u6548&#xff0c;\u65e0\u9700\u989d\u5916\u5904\u7406\u3002<\/p>\n<h4>5.2 \u5728 pos \u540e\u9762\u63d2\u5165<\/h4>\n<p>ErrorCode <span class=\"token function\">DDLinkListInsertBack<\/span><span class=\"token punctuation\">(<\/span>DDLinkList<span class=\"token operator\">*<\/span> plist<span class=\"token punctuation\">,<\/span> DDLinkListNode<span class=\"token operator\">*<\/span> pos<span class=\"token punctuation\">,<\/span><br \/>\n                               DataType val<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token comment\">\/\/ \u6821\u9a8c\u4e0e\u521b\u5efa\u8282\u70b9\u7701\u7565&#8230;<\/span><br \/>\n    <span class=\"token function\">InsertBefore<\/span><span class=\"token punctuation\">(<\/span>plist<span class=\"token punctuation\">,<\/span> pos<span class=\"token operator\">-&gt;<\/span>next<span class=\"token punctuation\">,<\/span> node<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>  <span class=\"token comment\">\/\/ \u2190 \u6838\u5fc3\u8f6c\u6362<\/span><br \/>\n    <span class=\"token keyword\">return<\/span> SUCCESS<span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>\u5728 pos \u540e\u9762\u63d2\u5165&#xff0c;\u7b49\u4ef7\u4e8e\u5728 pos-&gt;next \u524d\u9762\u63d2\u5165\u3002\u56e0\u4e3a\u5faa\u73af\u94fe\u8868\u4e2d pos-&gt;next \u6c38\u8fdc\u6709\u6548&#xff08;\u5373\u4f7f pos \u662f\u5c3e\u8282\u70b9&#xff0c;pos-&gt;next \u4e5f\u6307\u5411 head&#xff09;&#xff0c;\u6240\u4ee5\u8fd9\u4e2a\u8f6c\u6362\u4e0d\u9700\u8981\u4efb\u4f55\u8fb9\u754c\u5224\u65ad\u3002\u53cc\u5411\u5faa\u73af\u94fe\u8868\u7684\u8bbe\u8ba1\u4e4b\u7f8e&#xff0c;\u5728\u8fd9\u4e00\u523b\u4f53\u73b0\u5f97\u6dcb\u6f13\u5c3d\u81f4\u3002<\/p>\n<h3>6. \u67e5\u627e\u4e0e\u83b7\u53d6\u5934\u5c3e<\/h3>\n<h4>6.1 \u67e5\u627e\u8282\u70b9<\/h4>\n<p>DDLinkListNode<span class=\"token operator\">*<\/span> <span class=\"token function\">DDLinkListFind<\/span><span class=\"token punctuation\">(<\/span><span class=\"token keyword\">const<\/span> DDLinkList<span class=\"token operator\">*<\/span> plist<span class=\"token punctuation\">,<\/span> DataType val<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token comment\">\/\/ \u7a7a\u94fe\u8868\u68c0\u67e5\u7701\u7565&#8230;<\/span><br \/>\n    DDLinkListNode<span class=\"token operator\">*<\/span> cur <span class=\"token operator\">&#061;<\/span> plist<span class=\"token operator\">-&gt;<\/span>head<span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">do<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>cur<span class=\"token operator\">-&gt;<\/span>data <span class=\"token operator\">&#061;&#061;<\/span> val<span class=\"token punctuation\">)<\/span> <span class=\"token keyword\">return<\/span> cur<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    <span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">while<\/span> <span class=\"token punctuation\">(<\/span>cur <span class=\"token operator\">!&#061;<\/span> plist<span class=\"token operator\">-&gt;<\/span>head<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>   <span class=\"token comment\">\/\/ \u5faa\u73af\u4e00\u5708\u540e\u9000\u51fa<\/span><br \/>\n    <span class=\"token keyword\">return<\/span> <span class=\"token constant\">NULL<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>\u5faa\u73af\u94fe\u8868\u7684\u904d\u5386\u5fc5\u987b\u4f7f\u7528 do-while&#xff0c;\u56e0\u4e3a\u4e00\u5f00\u59cb cur \u5c31\u7b49\u4e8e head&#xff0c;\u5982\u679c\u4f7f\u7528 while \u4f1a\u76f4\u63a5\u8df3\u8fc7\u5faa\u73af\u4f53\u3002<\/p>\n<h4>6.2 \u83b7\u53d6\u5934\u90e8\u548c\u5c3e\u90e8\u6570\u636e<\/h4>\n<p>ErrorCode <span class=\"token function\">DDLinkListFront<\/span><span class=\"token punctuation\">(<\/span><span class=\"token keyword\">const<\/span> DDLinkList<span class=\"token operator\">*<\/span> plist<span class=\"token punctuation\">,<\/span> DataType<span class=\"token operator\">*<\/span> val<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token operator\">*<\/span>val <span class=\"token operator\">&#061;<\/span> plist<span class=\"token operator\">-&gt;<\/span>head<span class=\"token operator\">-&gt;<\/span>data<span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">return<\/span> SUCCESS<span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>ErrorCode <span class=\"token function\">DDLinkListBack<\/span><span class=\"token punctuation\">(<\/span><span class=\"token keyword\">const<\/span> DDLinkList<span class=\"token operator\">*<\/span> plist<span class=\"token punctuation\">,<\/span> DataType<span class=\"token operator\">*<\/span> val<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token operator\">*<\/span>val <span class=\"token operator\">&#061;<\/span> plist<span class=\"token operator\">-&gt;<\/span>head<span class=\"token operator\">-&gt;<\/span>prev<span class=\"token operator\">-&gt;<\/span>data<span class=\"token punctuation\">;<\/span>  <span class=\"token comment\">\/\/ \u2605 \u5faa\u73af\u94fe\u8868\u7684\u5c3e\u8282\u70b9\u5c31\u662f head-&gt;prev<\/span><br \/>\n    <span class=\"token keyword\">return<\/span> SUCCESS<span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>head-&gt;prev \u76f4\u63a5\u62ff\u5230\u5c3e\u8282\u70b9&#xff0c;\u65f6\u95f4\u590d\u6742\u5ea6 O(1)\u3002\u5355\u5411\u94fe\u8868\u9700\u8981\u4ece\u5934\u8dd1\u5230\u5c3e O(n)&#xff0c;\u5dee\u8ddd\u660e\u663e\u3002<\/p>\n<h3>7. \u5220\u9664\u64cd\u4f5c&#xff1a;\u901a\u7528\u6458\u9664\u516c\u5f0f<\/h3>\n<h4>7.1 \u5220\u9664\u6307\u5b9a\u8282\u70b9 Erase<\/h4>\n<p>ErrorCode <span class=\"token function\">DDLinkListErase<\/span><span class=\"token punctuation\">(<\/span>DDLinkList<span class=\"token operator\">*<\/span> plist<span class=\"token punctuation\">,<\/span> DDLinkListNode<span class=\"token operator\">*<\/span> pos<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token comment\">\/\/ \u6821\u9a8c\u7701\u7565&#8230;<\/span><\/p>\n<p>    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>pos<span class=\"token operator\">-&gt;<\/span>next <span class=\"token operator\">&#061;&#061;<\/span> pos<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span>         <span class=\"token comment\">\/\/ \u4ec5\u5269\u4e00\u4e2a\u8282\u70b9<\/span><br \/>\n        plist<span class=\"token operator\">-&gt;<\/span>head <span class=\"token operator\">&#061;<\/span> <span class=\"token constant\">NULL<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">else<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>pos <span class=\"token operator\">&#061;&#061;<\/span> plist<span class=\"token operator\">-&gt;<\/span>head<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span>   <span class=\"token comment\">\/\/ \u5220\u9664\u7684\u662f\u5934\u8282\u70b9<\/span><br \/>\n            plist<span class=\"token operator\">-&gt;<\/span>head <span class=\"token operator\">&#061;<\/span> pos<span class=\"token operator\">-&gt;<\/span>next<span class=\"token punctuation\">;<\/span> <span class=\"token comment\">\/\/ \u5148\u8f6c\u79fb head&#xff0c;\u518d\u6458\u9664 pos<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span><br \/>\n        <span class=\"token comment\">\/\/ \u901a\u7528\u6458\u9664\u64cd\u4f5c&#xff1a;\u8ba9\u524d\u9a71\u548c\u540e\u7ee7\u4e92\u8fde&#xff0c;\u7ed5\u8fc7 pos<\/span><br \/>\n        pos<span class=\"token operator\">-&gt;<\/span>prev<span class=\"token operator\">-&gt;<\/span>next <span class=\"token operator\">&#061;<\/span> pos<span class=\"token operator\">-&gt;<\/span>next<span class=\"token punctuation\">;<\/span><br \/>\n        pos<span class=\"token operator\">-&gt;<\/span>next<span class=\"token operator\">-&gt;<\/span>prev <span class=\"token operator\">&#061;<\/span> pos<span class=\"token operator\">-&gt;<\/span>prev<span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n    plist<span class=\"token operator\">-&gt;<\/span>size<span class=\"token operator\">&#8212;<\/span><span class=\"token punctuation\">;<\/span>    <span class=\"token comment\">\/\/ \u5148\u51cf\u5c11\u8ba1\u6570<\/span><br \/>\n    <span class=\"token function\">free<\/span><span class=\"token punctuation\">(<\/span>pos<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>        <span class=\"token comment\">\/\/ \u518d\u91ca\u653e\u8282\u70b9\u5185\u5b58<\/span><br \/>\n    <span class=\"token keyword\">return<\/span> SUCCESS<span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>\u53cc\u5411\u94fe\u8868\u5220\u9664\u7684\u7cbe\u9ad3\u5c31\u5728\u8fd9\u4e24\u884c&#xff1a;<\/p>\n<p>pos<span class=\"token operator\">-&gt;<\/span>prev<span class=\"token operator\">-&gt;<\/span>next <span class=\"token operator\">&#061;<\/span> pos<span class=\"token operator\">-&gt;<\/span>next<span class=\"token punctuation\">;<\/span>   <span class=\"token comment\">\/\/ \u524d\u9a71\u8df3\u8fc7 pos&#xff0c;\u8fde\u5230\u540e\u7ee7<\/span><br \/>\npos<span class=\"token operator\">-&gt;<\/span>next<span class=\"token operator\">-&gt;<\/span>prev <span class=\"token operator\">&#061;<\/span> pos<span class=\"token operator\">-&gt;<\/span>prev<span class=\"token punctuation\">;<\/span>   <span class=\"token comment\">\/\/ \u540e\u7ee7\u8df3\u8fc7 pos&#xff0c;\u8fde\u5230\u524d\u9a71<\/span><\/p>\n<p>\u65e0\u8bba pos \u662f\u5934\u8282\u70b9\u3001\u5c3e\u8282\u70b9\u8fd8\u662f\u4e2d\u95f4\u8282\u70b9&#xff0c;\u8fd9\u4e24\u884c\u4ee3\u7801\u90fd\u80fd\u6b63\u786e\u6458\u9664\u3002\u9700\u8981\u7279\u6b8a\u5904\u7406\u7684\u53ea\u6709\u4e24\u79cd\u60c5\u51b5&#xff1a;<\/p>\n<li>\u94fe\u8868\u53ea\u5269\u4e00\u4e2a\u8282\u70b9&#xff1a;\u76f4\u63a5\u7f6e\u7a7a head\u3002<\/li>\n<li>\u5220\u9664\u7684\u662f\u5934\u8282\u70b9&#xff1a;\u5148\u5c06 head \u6307\u5411 pos-&gt;next&#xff0c;\u9632\u6b62\u5934\u6307\u9488\u4e22\u5931\u3002<\/li>\n<p>\u56de\u60f3\u5355\u5411\u94fe\u8868\u5220\u9664\u7684\u70e6\u607c&#xff1a;\u5fc5\u987b\u5148\u627e\u5230\u524d\u9a71\u8282\u70b9\u3002\u800c\u8fd9\u91cc&#xff0c;pos-&gt;prev \u76f4\u63a5\u5c31\u662f\u524d\u9a71&#xff0c;O(1) \u4e00\u6b65\u5230\u4f4d\u3002<\/p>\n<p>\u4e3a\u4ec0\u4e48\u5148 size&#8211; \u518d free&#xff1f;\u5728\u8c03\u8bd5\u65f6&#xff0c;\u5982\u679c\u5148\u91ca\u653e\u8282\u70b9\u518d\u51cf\u5c11\u8ba1\u6570&#xff0c;\u800c\u6b64\u65f6\u7a0b\u5e8f\u56e0\u5176\u4ed6\u539f\u56e0\u5d29\u6e83&#xff0c;\u6253\u5370 size \u4f1a\u5f97\u5230\u9519\u8bef\u7684\u503c&#xff08;\u4ecd\u5305\u542b\u5df2\u91ca\u653e\u7684\u8282\u70b9&#xff09;\u3002\u5148\u51cf\u8ba1\u6570\u518d\u91ca\u653e&#xff0c;\u80fd\u8ba9\u8c03\u8bd5\u65e5\u5fd7\u5728\u4efb\u4f55\u65f6\u523b\u90fd\u53cd\u6620\u94fe\u8868\u7684\u771f\u5b9e\u72b6\u6001\u3002<\/p>\n<h4>7.2 \u6309\u503c\u5220\u9664 Remove<\/h4>\n<p>ErrorCode <span class=\"token function\">DDLinkListRemove<\/span><span class=\"token punctuation\">(<\/span>DDLinkList<span class=\"token operator\">*<\/span> plist<span class=\"token punctuation\">,<\/span> DataType val<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    DDLinkListNode<span class=\"token operator\">*<\/span> node <span class=\"token operator\">&#061;<\/span> <span class=\"token function\">DDLinkListFind<\/span><span class=\"token punctuation\">(<\/span>plist<span class=\"token punctuation\">,<\/span> val<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>node<span class=\"token punctuation\">)<\/span> <span class=\"token keyword\">return<\/span> <span class=\"token function\">DDLinkListErase<\/span><span class=\"token punctuation\">(<\/span>plist<span class=\"token punctuation\">,<\/span> node<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">return<\/span> ERR_DATA_NOT_EXISTS<span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>Find &#043; Erase \u7ec4\u5408&#xff0c;\u7b80\u6d01\u660e\u4e86\u3002<\/p>\n<h4>7.3 \u5220\u9664\u6240\u6709\u6307\u5b9a\u503c RemoveAll<\/h4>\n<p>\u8fd9\u4e2a\u51fd\u6570\u7684\u8bbe\u8ba1\u7a0d\u5fae\u590d\u6742\u4e00\u4e9b&#xff0c;\u9700\u8981\u683c\u5916\u5c0f\u5fc3\u5faa\u73af\u63a7\u5236\u3002<\/p>\n<p>ErrorCode <span class=\"token function\">DDLinkListRemoveAll<\/span><span class=\"token punctuation\">(<\/span>DDLinkList<span class=\"token operator\">*<\/span> plist<span class=\"token punctuation\">,<\/span> DataType val<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>plist <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 function\">LOG<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\u53c2\u6570\u9519\u8bef&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token keyword\">return<\/span> ERR_INVALID_PARAM<span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>plist<span class=\"token operator\">-&gt;<\/span>head <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 function\">LOG<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\u94fe\u8868\u4e3a\u7a7a&#xff0c;\u65e0\u6570\u636e\u53ef\u5220\u9664&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token keyword\">return<\/span> ERR_DATA_NOT_EXISTS<span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><\/p>\n<p>    DDLinkListNode<span class=\"token operator\">*<\/span> cur <span class=\"token operator\">&#061;<\/span> plist<span class=\"token operator\">-&gt;<\/span>head<span class=\"token operator\">-&gt;<\/span>next<span class=\"token punctuation\">;<\/span> <span class=\"token comment\">\/\/ \u4ece\u7b2c\u4e8c\u4e2a\u8282\u70b9\u5f00\u59cb<\/span><br \/>\n    <span class=\"token keyword\">do<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>cur<span class=\"token operator\">-&gt;<\/span>data <span class=\"token operator\">&#061;&#061;<\/span> val<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n            DDLinkListNode<span class=\"token operator\">*<\/span> toDel <span class=\"token operator\">&#061;<\/span> cur<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>               <span class=\"token comment\">\/\/ \u2460 \u5148\u79fb\u52a8 cur<\/span><br \/>\n            <span class=\"token function\">DDLinkListErase<\/span><span class=\"token punctuation\">(<\/span>plist<span class=\"token punctuation\">,<\/span> toDel<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token comment\">\/\/ \u2461 \u518d\u5220\u9664\u8282\u70b9<\/span><br \/>\n            <span class=\"token keyword\">continue<\/span><span class=\"token punctuation\">;<\/span>                      <span class=\"token comment\">\/\/ \u2605 \u8df3\u8fc7\u672b\u5c3e\u7684 cur &#061; cur-&gt;next<\/span><br \/>\n        <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    <span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">while<\/span> <span class=\"token punctuation\">(<\/span>cur <span class=\"token operator\">!&#061;<\/span> plist<span class=\"token operator\">-&gt;<\/span>head<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>          <span class=\"token comment\">\/\/ \u5faa\u73af\u81f3\u5934\u8282\u70b9\u524d\u505c\u6b62<\/span><\/p>\n<p>    <span class=\"token comment\">\/\/ \u5355\u72ec\u5224\u65ad\u5934\u8282\u70b9<\/span><br \/>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>plist<span class=\"token operator\">-&gt;<\/span>head <span class=\"token operator\">&amp;&amp;<\/span> plist<span class=\"token operator\">-&gt;<\/span>head<span class=\"token operator\">-&gt;<\/span>data <span class=\"token operator\">&#061;&#061;<\/span> val<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token function\">DDLinkListErase<\/span><span class=\"token punctuation\">(<\/span>plist<span class=\"token punctuation\">,<\/span> plist<span class=\"token operator\">-&gt;<\/span>head<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token keyword\">return<\/span> SUCCESS<span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>\u4e3a\u4ec0\u4e48\u5934\u8282\u70b9\u8981\u6700\u540e\u5355\u72ec\u5904\u7406&#xff1f;<\/p>\n<p>\u5982\u679c\u5934\u8282\u70b9\u5728\u5faa\u73af\u4e2d\u88ab\u5220\u4e86&#xff0c;plist-&gt;head \u4f1a\u66f4\u65b0\u4e3a\u4e0b\u4e00\u4e2a\u8282\u70b9&#xff0c;\u90a3\u4e48 while (cur !&#061; plist-&gt;head) \u8fd9\u4e2a\u7ec8\u6b62\u6761\u4ef6\u5c31\u4e0d\u7a33\u5b9a\u4e86\u2014\u2014head \u53d8\u4e86&#xff0c;cur \u4e5f\u53ef\u80fd\u56e0\u6b64\u65e0\u6cd5\u6b63\u786e\u56de\u5230\u8d77\u70b9\u3002\u628a\u6709\u53ef\u80fd\u6539\u53d8 head \u7684\u64cd\u4f5c\u653e\u5728\u6700\u540e\u5355\u72ec\u5904\u7406&#xff0c;\u662f\u6700\u7a33\u59a5\u7684\u5de5\u7a0b\u5b9e\u8df5\u3002<\/p>\n<p>\u5220\u9664\u540e\u4e3a\u4ec0\u4e48\u7528 **continue**&#xff1f;<\/p>\n<p>\u56e0\u4e3a cur \u5728\u5220\u9664\u524d\u5df2\u7ecf\u5411\u524d\u79fb\u52a8\u4e86\u4e00\u6b65&#xff08;cur &#061; cur-&gt;next&#xff09;&#xff0c;\u5982\u679c\u8ba9\u5faa\u73af\u672b\u5c3e\u7684 cur &#061; cur-&gt;next \u518d\u6267\u884c\u4e00\u6b21&#xff0c;\u5c31\u4f1a\u8df3\u8fc7\u4e00\u4e2a\u8282\u70b9\u3002\u6240\u4ee5\u7528 continue \u8df3\u8fc7\u5c3e\u90e8\u79fb\u52a8&#xff0c;\u4fdd\u8bc1\u904d\u5386\u4e0d\u4f1a\u6f0f\u8282\u70b9\u3002<\/p>\n<h3>8. \u9500\u6bc1\u94fe\u8868<\/h3>\n<p>ErrorCode <span class=\"token function\">DDLinkListDestroy<\/span><span class=\"token punctuation\">(<\/span>DDLinkList<span class=\"token operator\">*<\/span> plist<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>plist <span class=\"token operator\">&#061;&#061;<\/span> <span class=\"token constant\">NULL<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token keyword\">return<\/span> ERR_INVALID_PARAM<span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">while<\/span> <span class=\"token punctuation\">(<\/span>plist<span class=\"token operator\">-&gt;<\/span>head<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token function\">DDLinkListErase<\/span><span class=\"token punctuation\">(<\/span>plist<span class=\"token punctuation\">,<\/span> plist<span class=\"token operator\">-&gt;<\/span>head<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>  <span class=\"token comment\">\/\/ \u53cd\u590d\u5220\u9664\u5934\u8282\u70b9<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token keyword\">return<\/span> SUCCESS<span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>\u6bcf\u6b21\u5220\u9664\u5934\u8282\u70b9&#xff0c;Erase \u5185\u90e8\u4f1a\u81ea\u52a8\u66f4\u65b0 head&#xff08;\u5982\u679c\u53ea\u5269\u4e00\u4e2a\u8282\u70b9\u5219\u7f6e\u4e3a NULL&#xff0c;\u5426\u5219\u6307\u5411\u4e0b\u4e00\u4e2a\u8282\u70b9&#xff09;\u3002\u5f53 head \u53d8\u4e3a NULL \u65f6&#xff0c;\u5faa\u73af\u7ed3\u675f&#xff0c;\u94fe\u8868\u5b89\u5168\u9500\u6bc1\u3002<\/p>\n<h3>9. \u8bbe\u8ba1\u51b3\u7b56\u901f\u67e5\u8868<\/h3>\n<table>\n<tr>\u8bbe\u8ba1\u51b3\u7b56\u7406\u7531\u5e26\u6765\u7684\u597d\u5904<\/tr>\n<tbody>\n<tr>\n<td>\u589e\u52a0 prev \u6307\u9488<\/td>\n<td>\u9700\u8981 O(1) \u627e\u524d\u9a71<\/td>\n<td>\u5220\u9664\u8282\u70b9\u65e0\u9700\u904d\u5386\u627e\u524d\u9a71<\/td>\n<\/tr>\n<tr>\n<td>\u5faa\u73af\u7ed3\u6784&#xff08;\u5c3e\u2192\u5934&#xff09;<\/td>\n<td>head-&gt;prev \u5c31\u662f\u5c3e\u8282\u70b9<\/td>\n<td>\u5c3e\u63d2\u3001\u5c3e\u5220\u3001\u8bbf\u95ee\u5c3e\u90e8\u6570\u636e\u90fd\u662f O(1)<\/td>\n<\/tr>\n<tr>\n<td>\u4e0d\u5355\u72ec\u7ef4\u62a4 tail \u6307\u9488<\/td>\n<td>head-&gt;prev \u5df2\u5929\u7136\u5b9a\u4f4d\u5c3e\u8282\u70b9<\/td>\n<td>\u5c11\u4e00\u4e2a\u6210\u5458&#xff0c;\u5c11\u4e00\u4efd\u7ef4\u62a4\u6210\u672c<\/td>\n<\/tr>\n<tr>\n<td>InsertBefore \u4f5c\u4e3a\u63d2\u5165\u5f15\u64ce<\/td>\n<td>\u63d2\u5165\u64cd\u4f5c\u672c\u8d28\u90fd\u662f&#034;\u5728\u67d0\u8282\u70b9\u524d\u63d2\u5165&#034;<\/td>\n<td>\u5934\u63d2\u3001\u5c3e\u63d2\u3001\u524d\u63d2\u3001\u540e\u63d2\u5168\u90e8\u590d\u7528&#xff0c;\u4ee3\u7801\u91cf\u5927\u5e45\u51cf\u5c11<\/td>\n<\/tr>\n<tr>\n<td>\u5c3e\u63d2 &#061; InsertBefore(head) \u4e14\u4e0d\u66f4\u65b0 head<\/td>\n<td>\u5faa\u73af\u7ed3\u6784\u4e0b\u65b0\u8282\u70b9\u81ea\u52a8\u6210\u4e3a\u65b0\u5c3e\u8282\u70b9<\/td>\n<td>\u5c3e\u63d2 O(1)&#xff0c;\u5b9e\u73b0\u6781\u7b80<\/td>\n<\/tr>\n<tr>\n<td>\u540e\u63d2 &#061; InsertBefore(pos-&gt;next)<\/td>\n<td>\u5faa\u73af\u94fe\u8868 pos-&gt;next \u6c38\u8fdc\u6709\u6548<\/td>\n<td>\u65e0\u9700\u4efb\u4f55\u8fb9\u754c\u5224\u65ad<\/td>\n<\/tr>\n<tr>\n<td>RemoveAll \u5934\u8282\u70b9\u5ef6\u540e\u5904\u7406<\/td>\n<td>\u907f\u514d\u5220\u9664 head \u7834\u574f\u5faa\u73af\u7ec8\u6b62\u6761\u4ef6<\/td>\n<td>\u903b\u8f91\u66f4\u7a33\u5b9a&#xff0c;\u4e0d\u4f1a\u6b7b\u5faa\u73af\u6216\u6f0f\u5220<\/td>\n<\/tr>\n<tr>\n<td>\u9500\u6bc1\u7528 while(head) Erase(head)<\/td>\n<td>Erase \u5df2\u5c01\u88c5\u597d\u5934\u8282\u70b9\u8f6c\u79fb\u903b\u8f91<\/td>\n<td>\u9500\u6bc1\u51fd\u6570\u6781\u5176\u7b80\u6d01&#xff0c;\u4e0d\u6613\u51fa\u9519<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>10. \u5b66\u4e60\u4f53\u4f1a<\/h3>\n<p>\u5199\u5b8c\u53cc\u5411\u5faa\u73af\u94fe\u8868&#xff0c;\u6211\u6700\u5927\u7684\u611f\u53d7\u662f&#xff1a;\u597d\u7684\u6570\u636e\u7ed3\u6784\u8bbe\u8ba1&#xff0c;\u4e0d\u662f\u529f\u80fd\u7684\u5806\u780c&#xff0c;\u800c\u662f\u7528\u6700\u5c11\u7684\u4ee3\u7801&#xff0c;\u8986\u76d6\u6700\u591a\u7684\u573a\u666f\u3002<\/p>\n<p>InsertBefore \u4e00\u4e2a\u51fd\u6570&#xff0c;\u6491\u8d77\u4e86\u56db\u79cd\u63d2\u5165\u64cd\u4f5c\u3002pos-&gt;prev-&gt;next &#061; pos-&gt;next; pos-&gt;next-&gt;prev &#061; pos-&gt;prev; \u4e24\u884c\u4ee3\u7801&#xff0c;\u8986\u76d6\u4e86\u6240\u6709\u60c5\u51b5\u4e0b\u7684\u8282\u70b9\u6458\u9664\u3002\u56de\u60f3\u5355\u5411\u94fe\u8868\u91cc\u90a3\u4e9b\u5197\u957f\u7684\u7279\u6b8a\u5224\u65ad\u548c\u904d\u5386\u67e5\u627e&#xff0c;\u53cc\u5411\u94fe\u8868\u7528\u4e00\u6839\u989d\u5916\u7684 prev \u6307\u9488&#xff0c;\u6362\u6765\u4e86\u4ee3\u7801\u7684\u6781\u5927\u7b80\u6d01\u548c\u6267\u884c\u6548\u7387\u7684\u663e\u8457\u63d0\u5347\u3002<\/p>\n<p>\u8fd9\u5c31\u662f\u6570\u636e\u7ed3\u6784\u8bbe\u8ba1\u7684\u9b45\u529b&#xff1a;\u5728\u65f6\u95f4\u548c\u7a7a\u95f4\u4e4b\u95f4\u505a\u51fa\u6743\u8861&#xff0c;\u7528\u7cbe\u5de7\u7684\u7ed3\u6784\u8ba9\u7b97\u6cd5\u81ea\u7136\u53d8\u5feb\u3001\u53d8\u7b80\u5355\u3002\u4e0b\u4e00\u6b21\u5f53\u4f60\u89c9\u5f97\u67d0\u4e2a\u64cd\u4f5c\u5b9e\u73b0\u8d77\u6765\u5f88\u522b\u626d\u65f6&#xff0c;\u4e0d\u59a8\u56de\u5934\u5ba1\u89c6\u4e00\u4e0b&#xff1a;\u662f\u4e0d\u662f\u6570\u636e\u7ed3\u6784\u672c\u8eab\u9009\u5f97\u4e0d\u5bf9&#xff1f;\u6362\u6210\u53cc\u5411\u94fe\u8868&#xff0c;\u4e5f\u8bb8\u95ee\u9898\u5c31\u6d88\u5931\u4e86\u3002<\/p>\n<p>\u4ece\u5355\u5411\u5230\u53cc\u5411&#xff0c;\u4ece\u7ebf\u6027\u5230\u5faa\u73af&#xff0c;\u6211\u4eec\u4e00\u6b65\u4e00\u6b65\u628a\u94fe\u8868\u8fd9\u4e2a\u6700\u57fa\u7840\u7684\u6570\u636e\u7ed3\u6784\u5403\u900f\u3002\u4e0b\u4e00\u7bc7&#xff0c;\u6211\u4eec\u5c06\u5b66\u4e60\u6cdb\u578b\u53cc\u5411\u94fe\u8868\u3002\u656c\u8bf7\u671f\u5f85\u5427&#xff01;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u53cc\u5411\u5faa\u73af\u94fe\u8868&#xff1a;\u5355\u5411\u7684\u8fdb\u5316&#xff0c;\u63d2\u5165\u5220\u9664\u7684\u7ec8\u6781\u5f62\u6001<br \/>\n1. \u7075\u9b42\u62f7\u95ee&#xff1a;\u5355\u5411\u94fe\u8868\u4e0d\u591f\u7528\u4e86\u5417&#xff1f;<br \/>\n\u4e0a\u4e00\u7bc7\u6211\u4eec\u624b\u6495\u4e86\u5355\u5411\u94fe\u8868&#xff0c;\u5934\u63d2\u3001\u5c3e\u63d2\u3001\u67e5\u627e\u3001\u5220\u9664&#xff0c;\u6bcf\u4e2a\u64cd\u4f5c\u90fd\u5256\u6790\u5f97\u660e\u660e\u767d\u767d\u3002\u4f46\u5728\u5b9e\u9645\u52a8\u624b\u5199\u4ee3\u7801\u65f6&#xff0c;\u6211\u8e29\u5230\u4e86\u51e0\u4e2a\u75db\u5230\u523b\u9aa8\u94ed\u5fc3\u7684\u5751&#xff1a;<br \/>\n\u5c3e\u63d2\u5fc5\u987b\u4ece\u5934\u8dd1\u5230\u5c3e&#xff1a;\u6bcf\u6b21\u60f3\u5728\u672b\u5c3e\u52a0\u4e2a\u5143\u7d20&#xff0c;\u90fd\u8981 while(cur-&gt;next) \u904d\u5386\u6574\u6761\u94fe\u8868&#xff0c;\u65f6\u95f4\u590d\u6742\u5ea6 O(<\/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":[10336,174,371,1813,2640],"topic":[],"class_list":["post-92565","post","type-post","status-publish","format-standard","hentry","category-server","tag-10336","tag-c","tag-371","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>\u53cc\u5411\u5faa\u73af\u94fe\u8868\uff1a\u5355\u5411\u7684\u8fdb\u5316\uff0c\u63d2\u5165\u5220\u9664\u7684\u7ec8\u6781\u5f62\u6001 - \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\/92565.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u53cc\u5411\u5faa\u73af\u94fe\u8868\uff1a\u5355\u5411\u7684\u8fdb\u5316\uff0c\u63d2\u5165\u5220\u9664\u7684\u7ec8\u6781\u5f62\u6001 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u53cc\u5411\u5faa\u73af\u94fe\u8868&#xff1a;\u5355\u5411\u7684\u8fdb\u5316&#xff0c;\u63d2\u5165\u5220\u9664\u7684\u7ec8\u6781\u5f62\u6001 1. \u7075\u9b42\u62f7\u95ee&#xff1a;\u5355\u5411\u94fe\u8868\u4e0d\u591f\u7528\u4e86\u5417&#xff1f; \u4e0a\u4e00\u7bc7\u6211\u4eec\u624b\u6495\u4e86\u5355\u5411\u94fe\u8868&#xff0c;\u5934\u63d2\u3001\u5c3e\u63d2\u3001\u67e5\u627e\u3001\u5220\u9664&#xff0c;\u6bcf\u4e2a\u64cd\u4f5c\u90fd\u5256\u6790\u5f97\u660e\u660e\u767d\u767d\u3002\u4f46\u5728\u5b9e\u9645\u52a8\u624b\u5199\u4ee3\u7801\u65f6&#xff0c;\u6211\u8e29\u5230\u4e86\u51e0\u4e2a\u75db\u5230\u523b\u9aa8\u94ed\u5fc3\u7684\u5751&#xff1a; \u5c3e\u63d2\u5fc5\u987b\u4ece\u5934\u8dd1\u5230\u5c3e&#xff1a;\u6bcf\u6b21\u60f3\u5728\u672b\u5c3e\u52a0\u4e2a\u5143\u7d20&#xff0c;\u90fd\u8981 while(cur-&gt;next) \u904d\u5386\u6574\u6761\u94fe\u8868&#xff0c;\u65f6\u95f4\u590d\u6742\u5ea6 O(\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/92565.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-08-10T07:56:54+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=\"5 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/92565.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/92565.html\",\"name\":\"\u53cc\u5411\u5faa\u73af\u94fe\u8868\uff1a\u5355\u5411\u7684\u8fdb\u5316\uff0c\u63d2\u5165\u5220\u9664\u7684\u7ec8\u6781\u5f62\u6001 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-08-10T07:56:54+00:00\",\"dateModified\":\"2026-08-10T07:56:54+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/92565.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/92565.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/92565.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u53cc\u5411\u5faa\u73af\u94fe\u8868\uff1a\u5355\u5411\u7684\u8fdb\u5316\uff0c\u63d2\u5165\u5220\u9664\u7684\u7ec8\u6781\u5f62\u6001\"}]},{\"@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":"\u53cc\u5411\u5faa\u73af\u94fe\u8868\uff1a\u5355\u5411\u7684\u8fdb\u5316\uff0c\u63d2\u5165\u5220\u9664\u7684\u7ec8\u6781\u5f62\u6001 - \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\/92565.html","og_locale":"zh_CN","og_type":"article","og_title":"\u53cc\u5411\u5faa\u73af\u94fe\u8868\uff1a\u5355\u5411\u7684\u8fdb\u5316\uff0c\u63d2\u5165\u5220\u9664\u7684\u7ec8\u6781\u5f62\u6001 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u53cc\u5411\u5faa\u73af\u94fe\u8868&#xff1a;\u5355\u5411\u7684\u8fdb\u5316&#xff0c;\u63d2\u5165\u5220\u9664\u7684\u7ec8\u6781\u5f62\u6001 1. \u7075\u9b42\u62f7\u95ee&#xff1a;\u5355\u5411\u94fe\u8868\u4e0d\u591f\u7528\u4e86\u5417&#xff1f; \u4e0a\u4e00\u7bc7\u6211\u4eec\u624b\u6495\u4e86\u5355\u5411\u94fe\u8868&#xff0c;\u5934\u63d2\u3001\u5c3e\u63d2\u3001\u67e5\u627e\u3001\u5220\u9664&#xff0c;\u6bcf\u4e2a\u64cd\u4f5c\u90fd\u5256\u6790\u5f97\u660e\u660e\u767d\u767d\u3002\u4f46\u5728\u5b9e\u9645\u52a8\u624b\u5199\u4ee3\u7801\u65f6&#xff0c;\u6211\u8e29\u5230\u4e86\u51e0\u4e2a\u75db\u5230\u523b\u9aa8\u94ed\u5fc3\u7684\u5751&#xff1a; \u5c3e\u63d2\u5fc5\u987b\u4ece\u5934\u8dd1\u5230\u5c3e&#xff1a;\u6bcf\u6b21\u60f3\u5728\u672b\u5c3e\u52a0\u4e2a\u5143\u7d20&#xff0c;\u90fd\u8981 while(cur-&gt;next) \u904d\u5386\u6574\u6761\u94fe\u8868&#xff0c;\u65f6\u95f4\u590d\u6742\u5ea6 O(","og_url":"https:\/\/www.wsisp.com\/helps\/92565.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-08-10T07:56:54+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"5 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/92565.html","url":"https:\/\/www.wsisp.com\/helps\/92565.html","name":"\u53cc\u5411\u5faa\u73af\u94fe\u8868\uff1a\u5355\u5411\u7684\u8fdb\u5316\uff0c\u63d2\u5165\u5220\u9664\u7684\u7ec8\u6781\u5f62\u6001 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-08-10T07:56:54+00:00","dateModified":"2026-08-10T07:56:54+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/92565.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/92565.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/92565.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u53cc\u5411\u5faa\u73af\u94fe\u8868\uff1a\u5355\u5411\u7684\u8fdb\u5316\uff0c\u63d2\u5165\u5220\u9664\u7684\u7ec8\u6781\u5f62\u6001"}]},{"@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\/92565","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=92565"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/92565\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=92565"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=92565"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=92565"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=92565"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}