{"id":50233,"date":"2025-07-30T22:26:30","date_gmt":"2025-07-30T14:26:30","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/50233.html"},"modified":"2025-07-30T22:26:30","modified_gmt":"2025-07-30T14:26:30","slug":"%e7%ae%97%e6%b3%95%e5%ad%a6%e4%b9%a0%e7%ac%ac%e4%b8%89%e5%a4%a9-%e3%80%90%e5%bf%ab%e9%80%9f%e6%8e%92%e5%ba%8f%e3%80%91","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/50233.html","title":{"rendered":"\u7b97\u6cd5\u5b66\u4e60\u7b2c\u4e09\u5929 \u3010\u5feb\u901f\u6392\u5e8f\u3011"},"content":{"rendered":"<h2>\u5feb\u901f\u6392\u5e8f<\/h2>\n<h3>\u4e09\u8def\u5feb\u6392&#xff1a;\u539f\u7406\u4ecb\u7ecd&#xff08;\u9ad8\u6548\u5904\u7406\u91cd\u590d\u6570\u636e&#xff09;<\/h3>\n<p>\u5728\u5b66\u4e60\u5feb\u901f\u6392\u5e8f\u7684\u5206\u533a&#xff08;partition&#xff09;\u64cd\u4f5c\u524d&#xff0c;\u6211\u4eec\u53ef\u4ee5\u601d\u8003\u8fd9\u6837\u4e00\u4e2a\u95ee\u9898&#xff1a;<\/p>\n<p>\u7ed9\u5b9a\u4e00\u4e2a\u6570\u7ec4&#xff1a;[2, 7, 6, 1, 4, 5, 2, 3]<br \/>\n\u6211\u4eec\u5e0c\u671b\u9009\u62e9\u4e00\u4e2a\u57fa\u51c6\u503c&#xff08;pivot&#xff09;&#xff0c;\u6bd4\u5982\u9009\u6700\u53f3\u8fb9\u7684\u5143\u7d20 3&#xff0c;\u7136\u540e\u5bf9\u6570\u7ec4\u8fdb\u884c\u91cd\u65b0\u6392\u5217&#xff0c;\u4f7f\u5f97&#xff1a;<\/p>\n<ul>\n<li>\u6240\u6709\u00a0\u5c0f\u4e8e 3\u00a0\u7684\u5143\u7d20\u653e\u5728\u6570\u7ec4\u7684\u5de6\u8fb9&#xff1b;<\/li>\n<li>\u6240\u6709\u00a0\u7b49\u4e8e 3\u00a0\u7684\u5143\u7d20\u653e\u5728\u4e2d\u95f4&#xff1b;<\/li>\n<li>\u6240\u6709\u00a0\u5927\u4e8e 3\u00a0\u7684\u5143\u7d20\u653e\u5728\u53f3\u8fb9\u3002<\/li>\n<\/ul>\n<p>\u8fd9\u79cd\u5212\u5206\u65b9\u5f0f\u79f0\u4e3a \u4e09\u8def\u5212\u5206&#xff08;3-way partitioning&#xff09;&#xff0c;\u7279\u522b\u9002\u5408\u5904\u7406\u5305\u542b\u5927\u91cf\u91cd\u590d\u5143\u7d20\u7684\u6570\u7ec4\u3002<\/p>\n<p>\u4e3a\u4e86\u5b9e\u73b0\u8fd9\u4e00\u76ee\u6807&#xff0c;\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528 \u4e09\u4e2a\u6307\u9488&#xff08;\u6216\u533a\u95f4\u8fb9\u754c&#xff09; \u6765\u7ef4\u62a4\u4e09\u4e2a\u533a\u57df&#xff1a;<\/p>\n<ul>\n<li>lt&#xff1a;\u6307\u5411\u201c\u5c0f\u4e8e\u533a\u201d\u7684\u53f3\u8fb9\u754c&#xff08;\u5373\u5c0f\u4e8e pivot \u7684\u6700\u540e\u4e00\u4e2a\u4f4d\u7f6e&#xff09;<\/li>\n<li>gt&#xff1a;\u6307\u5411\u201c\u5927\u4e8e\u533a\u201d\u7684\u5de6\u8fb9\u754c&#xff08;\u5373\u5927\u4e8e pivot \u7684\u7b2c\u4e00\u4e2a\u4f4d\u7f6e&#xff09;<\/li>\n<li>i&#xff1a;\u5f53\u524d\u904d\u5386\u6307\u9488&#xff0c;\u4ece\u5de6\u5230\u53f3\u626b\u63cf\u6570\u7ec4<\/li>\n<\/ul>\n<p>\u521d\u59cb\u65f6&#xff1a;<\/p>\n<ul>\n<li>lt &#061; -1&#xff08;\u8868\u793a\u5c0f\u4e8e\u533a\u4e3a\u7a7a&#xff09;<\/li>\n<li>gt &#061; n&#xff08;\u5373\u00a0gt &#061; 8&#xff0c;\u8868\u793a\u5927\u4e8e\u533a\u4ece\u7d22\u5f15 8 \u5f00\u59cb&#xff0c;\u4e5f\u4e3a\u7a7a&#xff09;<\/li>\n<li>i &#061; 0&#xff08;\u4ece\u7b2c\u4e00\u4e2a\u5143\u7d20\u5f00\u59cb\u904d\u5386&#xff09;<\/li>\n<\/ul>\n<p>\u6211\u4eec\u4ee5 pivot &#061; 3 \u4e3a\u4f8b&#xff0c;\u5f00\u59cb\u904d\u5386&#xff08;i &lt; gt \u65f6\u7ee7\u7eed&#xff09;&#xff1a;<\/p>\n<p>\u904d\u5386\u89c4\u5219\u5982\u4e0b&#xff1a;<\/p>\n<li>\n<p>\u5982\u679c arr[i] &lt; pivot&#xff1a;<\/p>\n<ul>\n<li>\u5c06\u00a0arr[i]\u00a0\u4e0e\u00a0arr[lt &#043; 1]\u00a0\u4ea4\u6362&#xff08;\u6269\u5c55\u5c0f\u4e8e\u533a&#xff09;<\/li>\n<li>lt&#043;&#043;<\/li>\n<li>i&#043;&#043;<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u5982\u679c arr[i] &#061;&#061; pivot&#xff1a;<\/p>\n<ul>\n<li>\u4e0d\u9700\u8981\u4ea4\u6362&#xff0c;\u76f4\u63a5\u00a0i&#043;&#043;&#xff08;\u4fdd\u7559\u5728\u4e2d\u95f4\u533a\u57df&#xff09;<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u5982\u679c arr[i] &gt; pivot&#xff1a;<\/p>\n<ul>\n<li>\u5c06\u00a0arr[i]\u00a0\u4e0e\u00a0arr[gt &#8211; 1]\u00a0\u4ea4\u6362&#xff08;\u6269\u5c55\u5927\u4e8e\u533a&#xff09;<\/li>\n<li>gt&#8211;<\/li>\n<li>\u6ce8\u610f&#xff1a;\u6b64\u65f6\u00a0i\u00a0\u4e0d\u589e\u52a0&#xff0c;\u56e0\u4e3a\u4ece\u53f3\u8fb9\u6362\u8fc7\u6765\u7684\u65b0\u5143\u7d20\u8fd8\u672a\u68c0\u67e5&#xff01;<\/li>\n<\/ul>\n<\/li>\n<p>\u4e3e\u4f8b\u8bf4\u660e&#xff1a;<\/p>\n<p>\u521d\u59cb\u6570\u7ec4&#xff1a;[2, 7, 6, 1, 4, 5, 2, 3]&#xff0c;pivot &#061; 3<\/p>\n<p>\u7ecf\u8fc7\u4e09\u8def\u5212\u5206\u540e&#xff0c;\u6570\u7ec4\u53ef\u80fd\u53d8\u6210\u7c7b\u4f3c&#xff1a; [2, 1, 2, 3, 7, 6, 5, 4]<br \/>\n&#xff08;\u524d\u9762\u662f &lt;3 \u7684&#xff0c;\u4e2d\u95f4\u662f &#061;3 \u7684&#xff0c;\u540e\u9762\u662f &gt;3 \u7684&#xff09;<\/p>\n<p>\u6700\u7ec8&#xff0c;lt \u548c gt \u4e4b\u95f4\u7684\u5143\u7d20\u5c31\u662f\u6240\u6709\u7b49\u4e8e pivot \u7684\u503c&#xff0c;\u53ef\u7528\u4e8e\u540e\u7eed\u9012\u5f52\u5904\u7406\u5de6\u53f3\u4e24\u90e8\u5206\u3002<\/p>\n<hr \/>\n<p>\u6211\u4eec\u521a\u624d\u5b8c\u6210\u7684\u64cd\u4f5c&#xff0c;\u79f0\u4e3a \u5206\u533a&#xff08;Partition&#xff09;\u3002<br \/>\n\u5b83\u7684\u6838\u5fc3\u4f5c\u7528\u662f&#xff1a;\u7ed9\u5b9a\u4e00\u4e2a\u6570\u7ec4\u548c\u4e00\u4e2a\u57fa\u51c6\u503c&#xff08;pivot&#xff09;&#xff0c;\u901a\u8fc7\u91cd\u65b0\u6392\u5217&#xff0c;\u5c06\u6570\u7ec4\u5212\u5206\u4e3a\u4e09\u4e2a\u8fde\u7eed\u7684\u533a\u57df&#xff1a;<\/p>\n<ul>\n<li>\u5de6\u4fa7&#xff1a;\u6240\u6709\u00a0\u5c0f\u4e8e pivot\u00a0\u7684\u5143\u7d20<\/li>\n<li>\u4e2d\u95f4&#xff1a;\u6240\u6709\u00a0\u7b49\u4e8e pivot\u00a0\u7684\u5143\u7d20<\/li>\n<li>\u53f3\u4fa7&#xff1a;\u6240\u6709\u00a0\u5927\u4e8e pivot\u00a0\u7684\u5143\u7d20<\/li>\n<\/ul>\n<p>\u8fd9\u4e00\u8fc7\u7a0b\u5b8c\u6210\u540e&#xff0c;\u4e2d\u95f4\u533a\u57df&#xff08;\u5373\u6240\u6709\u7b49\u4e8e pivot \u7684\u5143\u7d20&#xff09;\u5c31\u5df2\u7ecf\u5904\u4e8e\u6700\u7ec8\u6392\u5e8f\u4f4d\u7f6e&#xff0c;\u65e0\u9700\u518d\u6b21\u8c03\u6574\u3002\u6211\u4eec\u53ea\u9700\u9012\u5f52\u5730\u5bf9\u5de6\u4fa7\u7684\u201c\u5c0f\u4e8e\u533a\u201d\u548c\u53f3\u4fa7\u7684\u201c\u5927\u4e8e\u533a\u201d\u91cd\u590d\u76f8\u540c\u7684\u5206\u533a\u64cd\u4f5c&#xff0c;\u5c31\u80fd\u9010\u6b65\u4f7f\u6574\u4e2a\u6570\u7ec4\u6709\u5e8f\u3002<\/p>\n<p>\u8bd5\u60f3&#xff0c;\u5982\u679c\u6211\u4eec\u5bf9\u5de6\u8fb9\u7684\u201c\u5c0f\u4e8e\u533a\u201d\u4e5f\u9009\u62e9\u4e00\u4e2a\u65b0\u7684\u57fa\u51c6\u503c&#xff0c;\u8fdb\u884c\u540c\u6837\u7684\u4e09\u8def\u5206\u533a&#xff1b;<br \/>\n\u540c\u65f6\u5bf9\u53f3\u8fb9\u7684\u201c\u5927\u4e8e\u533a\u201d\u4e5f\u5982\u6b64\u5904\u7406&#xff1b;<br \/>\n\u90a3\u4e48\u6bcf\u4e00\u5c42\u64cd\u4f5c\u90fd\u5728\u5c06\u95ee\u9898\u5206\u89e3\u4e3a\u66f4\u5c0f\u7684\u5b50\u95ee\u9898\u3002<br \/>\n\u968f\u7740\u9012\u5f52\u4e0d\u65ad\u6df1\u5165&#xff0c;\u5b50\u6570\u7ec4\u7684\u89c4\u6a21\u9010\u6e10\u7f29\u5c0f&#xff0c;\u76f4\u5230\u67d0\u4e2a\u5b50\u6570\u7ec4\u957f\u5ea6\u4e3a 0 \u6216 1 \u2014\u2014 \u6b64\u65f6\u5df2\u81ea\u7136\u6709\u5e8f\u3002<\/p>\n<p>\u5f53\u6240\u6709\u9012\u5f52\u8c03\u7528\u9010\u5c42\u8fd4\u56de\u65f6&#xff0c;\u6574\u4e2a\u6570\u7ec4\u4e5f\u5c31\u5b8c\u6210\u4e86\u6392\u5e8f\u3002<\/p>\n<h4>\u4ee3\u7801\u5b9e\u73b0<\/h4>\n<p>#include &lt;stdio.h&gt;<\/p>\n<p>void swap(int *a, int *b)<br \/>\n{<br \/>\n    int temp &#061; *a;<br \/>\n    *a &#061; *b;<br \/>\n    *b &#061; temp;<br \/>\n}<\/p>\n<p>void quickSort(int *nums, int low, int high)<br \/>\n{<br \/>\n    if (low &gt;&#061; high)<br \/>\n        return;<\/p>\n<p>    int pivot &#061; nums[low];<br \/>\n    int lt &#061; low;<br \/>\n    int gt &#061; high;<br \/>\n    int i &#061; low &#043; 1;<\/p>\n<p>    while (i &lt;&#061; gt){<br \/>\n        if (nums[i] &lt; pivot){<br \/>\n            swap(&amp;nums[lt], &amp;nums[i]);<br \/>\n            lt&#043;&#043;;<br \/>\n            i&#043;&#043;;<br \/>\n        }<br \/>\n        else if (nums[i] &gt; pivot){<br \/>\n            swap(&amp;nums[gt], &amp;nums[i]);<br \/>\n            gt&#8211;;<br \/>\n            \/\/ \u8fd9\u91cc i \u4e0d\u589e\u52a0&#xff0c;\u56e0\u4e3a\u8fd8\u6ca1\u6709\u6bd4\u8f83\u6362\u8fc7\u6765\u7684\u6570\u7684\u5927\u5c0f<br \/>\n        }<br \/>\n        else{<br \/>\n            i&#043;&#043;;<br \/>\n        }<br \/>\n    }<\/p>\n<p>    quickSort(nums, low, lt &#8211; 1);<br \/>\n    quickSort(nums, gt &#043; 1, high);<br \/>\n}<\/p>\n<p>int main()<br \/>\n{<br \/>\n    int nums[] &#061; {4,3,2,2,5,6,7,5,3,3,2,1,4};<br \/>\n    int len &#061; sizeof(nums) \/ sizeof(int);<\/p>\n<p>    \/\/ \u5feb\u901f\u6392\u5e8f<br \/>\n    quickSort(nums, 0, len &#8211; 1);<\/p>\n<p>    \/\/ \u6253\u5370\u8f93\u51fa<br \/>\n    for (int i &#061; 0; i &lt; len; i&#043;&#043;){<br \/>\n        printf(&#034;%d &#034;, nums[i]);<br \/>\n    }<br \/>\n    return 0;<br \/>\n}<\/p>\n<hr \/>\n<h3 style=\"background-color:transparent\">\u53cc\u8fb9\u626b\u63cf\u5feb\u6392&#xff1a;\u539f\u7406\u4ecb\u7ecd&#xff08;\u901a\u7528\u7b80\u6d01\u5199\u6cd5&#xff09;<\/h3>\n<p>\u8fd9\u662f\u4e00\u79cd\u901a\u7528\u3001\u76f4\u89c2\u3001\u5e7f\u6cdb\u6d41\u4f20\u7684\u5feb\u901f\u6392\u5e8f\u5b9e\u73b0&#xff0c;\u9002\u5408\u5927\u591a\u6570\u60c5\u51b5\u3002\u867d\u7136\u5728\u5927\u91cf\u91cd\u590d\u5143\u7d20\u4e0b\u4e0d\u5982\u4e09\u8def\u5feb\u6392\u9ad8\u6548&#xff0c;\u4f46\u4ee3\u7801\u7b80\u6d01&#xff0c;\u6613\u4e8e\u7406\u89e3\u548c\u6559\u5b66\u3002<\/p>\n<p>\u9009\u62e9\u6700\u5de6\u4fa7\u5143\u7d20\u4f5c\u4e3a pivot&#xff0c;\u4f7f\u7528\u4e24\u4e2a\u6307\u9488 left \u548c right \u4ece\u6570\u7ec4\u4e24\u7aef\u5411\u4e2d\u95f4\u626b\u63cf&#xff1a;<\/p>\n<ul>\n<li>right\u00a0\u4ece\u53f3\u5411\u5de6\u627e\u7b2c\u4e00\u4e2a\u5c0f\u4e8e pivot \u7684\u5143\u7d20<\/li>\n<li>left\u00a0\u4ece\u5de6\u5411\u53f3\u627e\u7b2c\u4e00\u4e2a\u5927\u4e8e pivot \u7684\u5143\u7d20<\/li>\n<li>\u627e\u5230\u540e\u4ea4\u6362\u4e24\u8005\u4f4d\u7f6e<\/li>\n<li>\u76f4\u5230\u00a0left &gt;&#061; right<\/li>\n<\/ul>\n<p>\u5faa\u73af\u7ed3\u675f\u540e&#xff0c;left&#xff08;\u6216 right&#xff09;\u6307\u5411\u7684\u4f4d\u7f6e\u5c31\u662f pivot \u7684\u6700\u7ec8\u4f4d\u7f6e\u3002\u5c06 nums[left] \u4e0e nums[low]&#xff08;\u539f\u59cb pivot&#xff09;\u4ea4\u6362&#xff0c;\u5b8c\u6210\u5206\u533a\u3002<\/p>\n<p>\u968f\u540e\u9012\u5f52\u5904\u7406 left \u5de6\u53f3\u4e24\u4e2a\u5b50\u6570\u7ec4\u3002<\/p>\n<h4>\u4ee3\u7801\u5b9e\u73b0<\/h4>\n<p>#include &lt;stdio.h&gt;<\/p>\n<p>void swap(int *a, int *b)<br \/>\n{<br \/>\n    int temp &#061; *a;<br \/>\n    *a &#061; *b;<br \/>\n    *b &#061; temp;<br \/>\n}<\/p>\n<p>void quickSort(int *nums, int low, int high)<br \/>\n{<br \/>\n    if (low &gt;&#061; high)<br \/>\n        return;<\/p>\n<p>    int pivot &#061; nums[low];<br \/>\n    int left &#061; low;<br \/>\n    int right &#061; high;<\/p>\n<p>    while (left &lt; right){<br \/>\n        while (left &lt; right &amp;&amp; nums[right] &gt;&#061; pivot)<br \/>\n            right&#8211;;<\/p>\n<p>        while (left &lt; right &amp;&amp; nums[left] &lt;&#061; pivot)<br \/>\n            left&#043;&#043;;<\/p>\n<p>        if (left &lt; right)<br \/>\n            swap(&amp;nums[left], &amp;nums[right]);<br \/>\n    }<\/p>\n<p>    swap(&amp;nums[left], &amp;nums[low]);<br \/>\n    quickSort(nums, low, left &#8211; 1);<br \/>\n    quickSort(nums, left &#043; 1, high);<br \/>\n}<\/p>\n<p>int main()<br \/>\n{<br \/>\n    int nums[] &#061; {2, 7, 6, 1, 4, 5, 2, 3};<br \/>\n    int len &#061; sizeof(nums) \/ sizeof(int);<\/p>\n<p>    \/\/ \u5feb\u901f\u6392\u5e8f<br \/>\n    quickSort(nums, 0, len &#8211; 1);<\/p>\n<p>    for (int i &#061; 0; i &lt; len; i&#043;&#043;)<br \/>\n        printf(&#034;%d &#034;, nums[i]);<\/p>\n<p>    return 0;<br \/>\n}<\/p>\n<h3>\u4e24\u79cd\u5b9e\u73b0\u5feb\u6392\u65b9\u6cd5\u7684\u5bf9\u6bd4<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"292\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730142629-688a2b95376e0.png\" width=\"545\" \/><\/p>\n<hr \/>\n<h3>\u4f18\u5316\u65b9\u6848<\/h3>\n<p>\u524d\u9762\u4ecb\u7ecd\u7684\u4e24\u79cd\u5feb\u6392\u5199\u6cd5&#xff0c;\u57fa\u51c6\u503c\u90fd\u662f\u56fa\u5b9a\u9009\u7684&#xff08;\u6bd4\u5982\u9009\u7b2c\u4e00\u4e2a\u6216\u6700\u540e\u4e00\u4e2a\u5143\u7d20&#xff09;\u3002\u8fd9\u79cd\u505a\u6cd5\u5728\u5927\u591a\u6570\u60c5\u51b5\u4e0b\u6548\u7387\u5f88\u9ad8&#xff0c;\u4f46\u5982\u679c\u9047\u5230\u5df2\u7ecf\u6709\u5e8f\u6216\u8005\u7279\u5b9a\u6392\u5217\u7684\u6570\u636e&#xff0c;\u6bcf\u6b21\u5212\u5206\u90fd\u6781\u4e0d\u5747\u8861&#xff0c;\u5c31\u4f1a\u5bfc\u81f4\u6027\u80fd\u6025\u5267\u4e0b\u964d&#xff0c;\u6700\u574f\u65f6\u95f4\u590d\u6742\u5ea6\u9000\u5316\u5230 O(n\u00b2)\u3002<\/p>\n<p>\u4e3a\u4e86\u907f\u514d\u8fd9\u79cd\u60c5\u51b5&#xff0c;\u6211\u4eec\u53ef\u4ee5\u6539\u8fdb\u57fa\u51c6\u503c\u7684\u9009\u62e9\u65b9\u5f0f&#xff0c;\u8ba9\u7b97\u6cd5\u66f4\u201c\u806a\u660e\u201d\u3001\u66f4\u7a33\u5b9a\u3002\u5e38\u7528\u7684\u4f18\u5316\u65b9\u6cd5\u6709&#xff1a;<\/p>\n<ul>\n<li>\u4e09\u6570\u53d6\u4e2d&#xff1a;\u53d6\u6570\u7ec4\u7684\u7b2c\u4e00\u4e2a\u3001\u4e2d\u95f4\u7684\u548c\u6700\u540e\u4e00\u4e2a\u5143\u7d20&#xff0c;\u9009\u5176\u4e2d\u7684\u4e2d\u4f4d\u6570\u4f5c\u4e3a\u57fa\u51c6&#xff0c;\u907f\u514d\u6781\u7aef\u60c5\u51b5\u3002<\/li>\n<li>\u968f\u673a\u9009\u57fa\u51c6&#xff1a;\u968f\u673a\u4ece\u6570\u7ec4\u4e2d\u9009\u4e00\u4e2a\u5143\u7d20\u4f5c\u4e3a\u57fa\u51c6&#xff0c;\u7528\u968f\u673a\u6027\u6765\u5bf9\u6297\u574f\u6570\u636e\u3002<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb401\u6b21\uff0c\u70b9\u8d5e7\u6b21\uff0c\u6536\u85cf3\u6b21\u3002\u8fd9\u662f\u4e00\u79cd\u901a\u7528\u3001\u76f4\u89c2\u3001\u5e7f\u6cdb\u6d41\u4f20\u7684\u5feb\u901f\u6392\u5e8f\u5b9e\u73b0\uff0c\u9002\u5408\u5927\u591a\u6570\u60c5\u51b5\u3002\u867d\u7136\u5728\u5927\u91cf\u91cd\u590d\u5143\u7d20\u4e0b\u4e0d\u5982\u4e09\u8def\u5feb\u6392\u9ad8\u6548\uff0c\u4f46\u4ee3\u7801\u7b80\u6d01\uff0c\u6613\u4e8e\u7406\u89e3\u548c\u6559\u5b66\u3002\u9009\u62e9\u6700\u5de6\u4fa7\u5143\u7d20\u4f5c\u4e3a pivot\uff0c\u4f7f\u7528\u4e24\u4e2a\u6307\u9488left\u548crightright\u4ece\u53f3\u5411\u5de6\u627e\u7b2c\u4e00\u4e2a\u5c0f\u4e8e pivot \u7684\u5143\u7d20left\u4ece\u5de6\u5411\u53f3\u627e\u7b2c\u4e00\u4e2a\u5927\u4e8e pivot \u7684\u5143\u7d20\u627e\u5230\u540e\u4ea4\u6362\u4e24\u8005\u4f4d\u7f6e\u76f4\u5230\u5faa\u73af\u7ed3\u675f\u540e\uff0cleft\uff08\u6216right\uff09\u6307\u5411\u7684\u4f4d\u7f6e\u5c31\u662f pivot \u7684\u6700\u7ec8\u4f4d\u7f6e\u3002\u5c06nums[left]\u4e0enums[low]\uff08\u539f\u59cb pivot\uff09\u4ea4\u6362\uff0c\u5b8c\u6210\u5206\u533a\u3002\u968f\u540e\u9012\u5f52\u5904\u7406left\u3002<\/p>\n","protected":false},"author":2,"featured_media":50232,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[4894,427],"topic":[],"class_list":["post-50233","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-4894","tag-427"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u7b97\u6cd5\u5b66\u4e60\u7b2c\u4e09\u5929 \u3010\u5feb\u901f\u6392\u5e8f\u3011 - \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\/50233.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u7b97\u6cd5\u5b66\u4e60\u7b2c\u4e09\u5929 \u3010\u5feb\u901f\u6392\u5e8f\u3011 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb401\u6b21\uff0c\u70b9\u8d5e7\u6b21\uff0c\u6536\u85cf3\u6b21\u3002\u8fd9\u662f\u4e00\u79cd\u901a\u7528\u3001\u76f4\u89c2\u3001\u5e7f\u6cdb\u6d41\u4f20\u7684\u5feb\u901f\u6392\u5e8f\u5b9e\u73b0\uff0c\u9002\u5408\u5927\u591a\u6570\u60c5\u51b5\u3002\u867d\u7136\u5728\u5927\u91cf\u91cd\u590d\u5143\u7d20\u4e0b\u4e0d\u5982\u4e09\u8def\u5feb\u6392\u9ad8\u6548\uff0c\u4f46\u4ee3\u7801\u7b80\u6d01\uff0c\u6613\u4e8e\u7406\u89e3\u548c\u6559\u5b66\u3002\u9009\u62e9\u6700\u5de6\u4fa7\u5143\u7d20\u4f5c\u4e3a pivot\uff0c\u4f7f\u7528\u4e24\u4e2a\u6307\u9488left\u548crightright\u4ece\u53f3\u5411\u5de6\u627e\u7b2c\u4e00\u4e2a\u5c0f\u4e8e pivot \u7684\u5143\u7d20left\u4ece\u5de6\u5411\u53f3\u627e\u7b2c\u4e00\u4e2a\u5927\u4e8e pivot \u7684\u5143\u7d20\u627e\u5230\u540e\u4ea4\u6362\u4e24\u8005\u4f4d\u7f6e\u76f4\u5230\u5faa\u73af\u7ed3\u675f\u540e\uff0cleft\uff08\u6216right\uff09\u6307\u5411\u7684\u4f4d\u7f6e\u5c31\u662f pivot \u7684\u6700\u7ec8\u4f4d\u7f6e\u3002\u5c06nums[left]\u4e0enums[low]\uff08\u539f\u59cb pivot\uff09\u4ea4\u6362\uff0c\u5b8c\u6210\u5206\u533a\u3002\u968f\u540e\u9012\u5f52\u5904\u7406left\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/50233.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-07-30T14:26:30+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730142629-688a2b95376e0.png\" \/>\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=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/50233.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/50233.html\",\"name\":\"\u7b97\u6cd5\u5b66\u4e60\u7b2c\u4e09\u5929 \u3010\u5feb\u901f\u6392\u5e8f\u3011 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-07-30T14:26:30+00:00\",\"dateModified\":\"2025-07-30T14:26:30+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/50233.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/50233.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/50233.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u7b97\u6cd5\u5b66\u4e60\u7b2c\u4e09\u5929 \u3010\u5feb\u901f\u6392\u5e8f\u3011\"}]},{\"@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":"\u7b97\u6cd5\u5b66\u4e60\u7b2c\u4e09\u5929 \u3010\u5feb\u901f\u6392\u5e8f\u3011 - \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\/50233.html","og_locale":"zh_CN","og_type":"article","og_title":"\u7b97\u6cd5\u5b66\u4e60\u7b2c\u4e09\u5929 \u3010\u5feb\u901f\u6392\u5e8f\u3011 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb401\u6b21\uff0c\u70b9\u8d5e7\u6b21\uff0c\u6536\u85cf3\u6b21\u3002\u8fd9\u662f\u4e00\u79cd\u901a\u7528\u3001\u76f4\u89c2\u3001\u5e7f\u6cdb\u6d41\u4f20\u7684\u5feb\u901f\u6392\u5e8f\u5b9e\u73b0\uff0c\u9002\u5408\u5927\u591a\u6570\u60c5\u51b5\u3002\u867d\u7136\u5728\u5927\u91cf\u91cd\u590d\u5143\u7d20\u4e0b\u4e0d\u5982\u4e09\u8def\u5feb\u6392\u9ad8\u6548\uff0c\u4f46\u4ee3\u7801\u7b80\u6d01\uff0c\u6613\u4e8e\u7406\u89e3\u548c\u6559\u5b66\u3002\u9009\u62e9\u6700\u5de6\u4fa7\u5143\u7d20\u4f5c\u4e3a pivot\uff0c\u4f7f\u7528\u4e24\u4e2a\u6307\u9488left\u548crightright\u4ece\u53f3\u5411\u5de6\u627e\u7b2c\u4e00\u4e2a\u5c0f\u4e8e pivot \u7684\u5143\u7d20left\u4ece\u5de6\u5411\u53f3\u627e\u7b2c\u4e00\u4e2a\u5927\u4e8e pivot \u7684\u5143\u7d20\u627e\u5230\u540e\u4ea4\u6362\u4e24\u8005\u4f4d\u7f6e\u76f4\u5230\u5faa\u73af\u7ed3\u675f\u540e\uff0cleft\uff08\u6216right\uff09\u6307\u5411\u7684\u4f4d\u7f6e\u5c31\u662f pivot \u7684\u6700\u7ec8\u4f4d\u7f6e\u3002\u5c06nums[left]\u4e0enums[low]\uff08\u539f\u59cb pivot\uff09\u4ea4\u6362\uff0c\u5b8c\u6210\u5206\u533a\u3002\u968f\u540e\u9012\u5f52\u5904\u7406left\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/50233.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-07-30T14:26:30+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730142629-688a2b95376e0.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/50233.html","url":"https:\/\/www.wsisp.com\/helps\/50233.html","name":"\u7b97\u6cd5\u5b66\u4e60\u7b2c\u4e09\u5929 \u3010\u5feb\u901f\u6392\u5e8f\u3011 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-07-30T14:26:30+00:00","dateModified":"2025-07-30T14:26:30+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/50233.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/50233.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/50233.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u7b97\u6cd5\u5b66\u4e60\u7b2c\u4e09\u5929 \u3010\u5feb\u901f\u6392\u5e8f\u3011"}]},{"@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\/50233","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=50233"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/50233\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/50232"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=50233"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=50233"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=50233"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=50233"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}