{"id":380,"date":"2023-05-06T21:12:33","date_gmt":"2023-05-06T13:12:33","guid":{"rendered":"https:\/\/blog.taiyang.space\/?p=380"},"modified":"2023-05-06T21:12:34","modified_gmt":"2023-05-06T13:12:34","slug":"%e7%ac%ac8%e7%ab%a0-%e6%8e%92%e5%ba%8f","status":"publish","type":"post","link":"https:\/\/blog.taiyang.space\/?p=380","title":{"rendered":"\u7b2c8\u7ae0-\u6392\u5e8f"},"content":{"rendered":"<h2>8.1 \u57fa\u672c\u6982\u5ff5\u548c\u6392\u5e8f\u65b9\u6cd5\u6982\u8ff0<\/h2>\n<h3>8.1.1 \u6392\u5e8f\u7684\u57fa\u672c\u6982\u5ff5<\/h3>\n<p>\u4ec0\u4e48\u662f\u6392\u5e8f\uff1f<\/p>\n<p>\u6392\u5e8f\uff1a\u6392\u5e8f\uff1a\u5c06\u4e00\u7ec4\u6742\u4e71\u65e0\u7ae0\u7684\u6570\u636e\u6309\u4e00\u5b9a\u89c4\u5f8b\u987a\u6b21\u6392\u5217\u8d77\u6765\u3002\u5373\uff0c\u5c06\u65e0\u5e8f\u5e8f\u5217\u6392\u6210\u4e00\u4e2a\u6709\u5e8f\u5e8f\u5217\uff08\u7531\u5c0f\u5230\u5927\u6216\u7531\u5927\u5230\u5c0f\uff09\u7684\u8fd0\u7b97\u3002<\/p>\n<p>\u5982\u679c\u53c2\u52a0\u6392\u5e8f\u7684\u6570\u636e\u7ed3\u70b9\u5305\u542b\u591a\u4e2a\u6570\u636e\u57df\uff0c\u90a3\u4e48\u6392\u5e8f\u5f80\u5f80\u662f\u9488\u5bf9\u5176\u4e2d\u67d0\u4e2a\u57df\u800c\u8a00<\/p>\n<p>&nbsp;<\/p>\n<p>\u6392\u5e8f\u65b9\u6cd5\u7684\u5206\u7c7b<\/p>\n<ul>\n<li>\u6309\u6570\u636e\u5b58\u50a8\u4ecb\u8d28\uff1a\n<ul>\n<li>\u5185\u90e8\u6392\u5e8f\uff1a\u6570\u636e\u91cf\u4e0d\u5927\u3001\u6570\u636e\u5728<strong>\u5185\u5b58<\/strong>\uff0c\u65e0\u9700\u5185\u5916\u5b58\u4ea4\u6362\u6570\u636e<\/li>\n<li>\u5916\u90e8\u6392\u5e8f\uff1a\u6570\u636e\u91cf\u8f83\u5927\u3001\u6570\u636e\u5728<strong>\u5916\u5b58<\/strong>\uff08\u6587\u4ef6\u6392\u5e8f\uff09<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u5916\u90e8\u6392\u5e8f\u65f6\uff0c\u8981\u5c06\u6570\u636e\u5206\u6279\u8c03\u5165\u5185\u5b58\u6765\u6392\u5e8f\uff0c\u4e2d\u95f4\u7ed3\u679c\u8fd8\u8981\u53ca\u65f6\u653e\u5165\u5916\u5b58\uff0c\u663e\u7136\u5916\u90e8\u6392\u5e8f\u8981\u590d\u6742\u5f97\u591a<\/p>\n<p>&nbsp;<\/p>\n<ul>\n<li>\u6309\u6bd4\u8f83\u5668\u4e2a\u6570\uff1a\n<ul>\n<li>\u4e32\u884c\u6392\u5e8f\uff1a\u5355\u5904\u7406\u673a\uff08\u540c\u4e00\u65f6\u523b\u6bd4\u8f83\u4e00\u5bf9\u5143\u7d20\uff09<\/li>\n<li>\u5e76\u884c\u6392\u5e8f\uff1a\u591a\u5904\u7406\u673a\uff08\u540c\u4e00\u65f6\u523b\u6bd4\u8f83\u591a\u5bf9\u5143\u7d20\uff09<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul>\n<li>\u6309\u8f85\u52a9\u7a7a\u95f4\uff1a\n<ul>\n<li>\u539f\u5730\u6392\u5e8f\uff1a\u8f85\u52a9\u7a7a\u95f4\u7528\u91cf\u4e3aO(1)\u7684\u6392\u5e8f\u65b9\u6cd5\uff08\u6240\u5360\u7684\u8f85\u52a9\u7a7a\u95f4\u4e0e\u53c2\u52a0\u6392\u5e8f\u7684\u6570\u636e\u91cf\u5927\u5c0f\u65e0\u5173\uff09<\/li>\n<li>\u975e\u539f\u5730\u6392\u5e8f\uff1a\u8f85\u52a9\u7a7a\u95f4\u7528\u91cf\u8d85\u8fc7O(1)\u7684\u6392\u5e8f\u65b9\u6cd5<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul>\n<li>\u6309\u7a33\u5b9a\u6027\uff1a\n<ul>\n<li>\u7a33\u5b9a\u6392\u5e8f\uff1a\u80fd\u591f\u4f7f\u4efb\u4f55\u6570\u503c\u76f8\u7b49\u7684\u5143\u7d20\uff0c\u6392\u5e8f\u4ee5\u540e\u76f8\u5bf9\u6b21\u5e8f\u4e0d\u53d8<\/li>\n<li>\u975e\u7a33\u5b9a\u6392\u5e8f\uff1a\u4e0d\u662f\u7a33\u5b9a\u6392\u5e8f\u7684\u65b9\u6cd5<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"https:\/\/picture.chentaiyang.space\/202304251441144.png\" referrerpolicy=\"no-referrer\" alt=\"img\"><\/p>\n<p>\u793a\u4f8b1\u662f\u7a33\u5b9a\u6392\u5e8f\uff0c\u793a\u4f8b2\u662f\u4e0d\u7a33\u5b9a\u6392\u5e8f<\/p>\n<p>\u6392\u5e8f\u7684\u7a33\u5b9a\u6027\u53ea\u5bf9\u7ed3\u6784\u7c7b\u578b\u6570\u636e\u6392\u5e8f\u6709\u610f\u4e49\uff0c\u6392\u5e8f\u65b9\u6cd5\u662f\u5426\u7a33\u5b9a\uff0c\u5e76\u4e0d\u80fd\u8861\u91cf\u4e00\u4e2a\u6392\u5e8f\u7b97\u6cd5\u7684\u4f18\u52a3<\/p>\n<p>&nbsp;<\/p>\n<ul>\n<li>\u6309\u81ea\u7136\u6027\uff1a\n<ul>\n<li>\u81ea\u7136\u6392\u5e8f\uff1a\u8f93\u5165\u6570\u636e\u8d8a\u6709\u5e8f\uff0c\u6392\u5e8f\u7684\u901f\u5ea6\u8d8a\u5feb\u7684\u6392\u5e8f\u65b9\u6cd5<\/li>\n<li>\u975e\u81ea\u7136\u6392\u5e8f\uff1a\u4e0d\u662f\u81ea\u7136\u6392\u5e8f\u7684\u65b9\u6cd5<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h3>8.1.2 \u5f85\u6392\u5e8f\u8bb0\u5f55\u7684\u5b58\u50a8\u65b9\u5f0f<\/h3>\n<p>\u8bb0\u5f55\u5e8f\u5217\u4ee5\u987a\u5e8f\u8868\u5b58\u50a8<\/p>\n<pre><code class=\"language-cpp\" lang=\"cpp\">#define MAXSIZE 20\n\ntypedef int keyType;\n\ntypedef struct {\n\tkeyType key;\n\t\/\/ other data\n}recordType;\n\n\ntypedef struct {\n\trecordType r[MAXSIZE + 1];\n\tint length;\n}suquenList;\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n<h2>8.2 \u63d2\u5165\u6392\u5e8f<\/h2>\n<p>\u57fa\u672c\u601d\u60f3\uff1a\u6bcf\u6b65\u5c06\u4e00\u4e2a\u5f85\u6392\u5e8f\u7684\u5bf9\u8c61\uff0c\u6309\u5176\u5173\u952e\u7801\u5927\u5c0f\uff0c\u63d2\u5165\u5230\u524d\u9762\u5df2\u7ecf\u6392\u597d\u5e8f\u7684\u4e00\u7ec4\u5bf9\u8c61\u7684\u9002\u5f53\u4f4d\u7f6e\u4e0a\uff0c\u76f4\u5230\u5bf9\u8c61\u5168\u90e8\u63d2\u5165\u4e3a\u6b62<\/p>\n<p>&nbsp;<\/p>\n<p>\u57fa\u672c\u64cd\u4f5c\uff1a\u6709\u5e8f\u63d2\u5165<\/p>\n<ul>\n<li>\u5728\u6709\u5e8f\u5e8f\u5217\u4e2d\u63d2\u5165\u4e00\u4e2a\u5143\u7d20\uff0c\u4fdd\u6301\u5e8f\u5217\u6709\u5e8f\uff0c\u6709\u5e8f\u957f\u5ea6\u4e0d\u65ad\u589e\u52a0<\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"https:\/\/picture.chentaiyang.space\/202304251441147.png\" referrerpolicy=\"no-referrer\" alt=\"img\"><\/p>\n<p>&nbsp;<\/p>\n<p>\u63d2\u5165\u6392\u5e8f\u7684\u79cd\u7c7b<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/picture.chentaiyang.space\/202304251441145.png\" referrerpolicy=\"no-referrer\" alt=\"img\"><\/p>\n<p>&nbsp;<\/p>\n<h3>8.2.1 \u76f4\u63a5\u63d2\u5165\u6392\u5e8f<\/h3>\n<p><img decoding=\"async\" src=\"https:\/\/picture.chentaiyang.space\/202304251441150.png\" referrerpolicy=\"no-referrer\" alt=\"img\"><\/p>\n<p>&nbsp;<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/picture.chentaiyang.space\/202304251441154.png\" referrerpolicy=\"no-referrer\" alt=\"img\"><\/p>\n<pre><code class=\"language-cpp\" lang=\"cpp\">\/*******************************************************************************************************************************\n * @description\uff1a\u76f4\u63a5\u63d2\u5165\u6392\u5e8f\n * @param\uff1aL\n *\/\nvoid directInsertionSort(sequenList&amp; L)\n{\n\tint i, j;\n\tfor (i = 2; i &lt;= L.length; i++) {\n\t\tif (L.r[i].key &lt; L.r[i - 1].key) {\n\t\t\tL.r[0] = L.r[i];\n\t\t\tfor (j = i - 1; L.r[0].key &lt; L.r[j].key; j--) {\n\t\t\t\tL.r[j + 1] = L.r[j];\n\t\t\t}\n\t\t\tL.r[j + 1] = L.r[0];\n\t\t}\n\t}\n}\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p>\u6027\u80fd\u5206\u6790<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/picture.chentaiyang.space\/202304251441153.png\" referrerpolicy=\"no-referrer\" alt=\"img\"><\/p>\n<p>&nbsp;<\/p>\n<p>\u7ed3\u8bba\uff1a<\/p>\n<ul>\n<li>\u5143\u7d20\u6570\u636e\u8d8a\u63a5\u8fd1\u6709\u5e8f\uff0c\u6392\u5e8f\u901f\u5ea6\u8d8a\u5feb<\/li>\n<li>\u6700\u574f\u60c5\u51b5\u4e0b\uff08\u8f93\u5165\u7684\u6570\u636e\u662f\u9006\u6709\u5e8f\u7684\uff09Tw(n) = O(n^2)<\/li>\n<li>\u5e73\u5747\u60c5\u51b5\u4e0b\uff0c\u8017\u65f6\u5dee\u4e0d\u591a\u662f\u6700\u574f\u60c5\u51b5\u7684\u4e00\u534a Te(n) = O(n^2)<\/li>\n<li>\u8981\u63d0\u9ad8\u67e5\u627e\u901f\u5ea6\n<ul>\n<li>\u51cf\u5c11\u5143\u7d20\u7684\u6bd4\u8f83\u6b21\u6570<\/li>\n<li>\u51cf\u5c11\u5143\u7d20\u7684\u79fb\u52a8\u6b21\u6570<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h3>8.2.2 \u6298\u534a\u63d2\u5165\u6392\u5e8f<\/h3>\n<p><img decoding=\"async\" src=\"https:\/\/picture.chentaiyang.space\/202304251441932.png\" referrerpolicy=\"no-referrer\" alt=\"img\"><\/p>\n<pre><code class=\"language-cpp\" lang=\"cpp\">\/*******************************************************************************************************************************\n * @description\uff1a\u6298\u534a\u63d2\u5165\u6392\u5e8f\n * @param\uff1aL\n *\/\nvoid binaryInsertionSort(sequenList&amp; L)\n{\n\tint i, j, low, high, mid;\n\tfor (i = 2; i &lt;= L.length; i++) {\n\t\tL.r[0] = L.r[i];\n\t\t\/\/ \u4e8c\u5206\u67e5\u627e\n\t\tlow = 1;\n\t\thigh = i - 1;\n\t\twhile (low &lt;= high) {\n\t\t\tmid = (low + high) \/ 2;\n\t\t\tif (L.r[0].key &lt; L.r[mid].key) {\n\t\t\t\thigh = mid - 1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tlow = mid + 1;\n\t\t\t}\n\t\t}\n\t\t\/\/ \u5faa\u73af\u7ed3\u675f\uff0chigh+1\u5219\u4e3a\u63d2\u5165\u4f4d\u7f6e\uff0c\u79fb\u52a8\u5143\u7d20\n\t\tfor (j = i - 1; j &gt;= high + 1; j--) {\n\t\t\tL.r[j + 1] = L.r[j];\n\t\t}\n\t\tL.r[high + 1] = L.r[0];\n\t}\n}\n<\/code><\/pre>\n<p>\u6298\u534a\u63d2\u5165\u6392\u5e8f\u7684\u5bf9\u8c61\u79fb\u52a8\u6b21\u6570\u4e0e\u76f4\u63a5\u63d2\u5165\u6392\u5e8f\u76f8\u540c\uff0c\u4f9d\u8d56\u4e8e\u5bf9\u8c61\u7684\u521d\u59cb\u6392\u5217<\/p>\n<ul>\n<li>\u51cf\u5c11\u4e86\u6bd4\u8f83\u6b21\u6570\uff0c\u4f46\u6ca1\u6709\u51cf\u5c11\u79fb\u52a8\u6b21\u6570<\/li>\n<li>\u5e73\u5747\u6027\u80fd\u4f18\u4e8e\u76f4\u63a5\u63d2\u5165\u6392\u5e8f<\/li>\n<\/ul>\n<p>\u65f6\u95f4\u590d\u6742\u5ea6\uff1aO(n^2)<\/p>\n<p>\u7a7a\u95f4\u590d\u6742\u5ea6\uff1aO(1)<\/p>\n<p>\u662f\u4e00\u79cd\u7a33\u5b9a\u7684\u6392\u5e8f\u65b9\u6cd5<\/p>\n<p>&nbsp;<\/p>\n<h3>8.2.3 \u5e0c\u5c14\u6392\u5e8f<\/h3>\n<p>\u57fa\u672c\u601d\u60f3\uff1a\u5148\u5c06\u6574\u4e2a\u5f85\u6392\u5e8f\u8bb0\u5f55\u5e8f\u5217\u5206\u5272\u6210\u82e5\u5e72\u5b50\u5e8f\u5217\uff0c\u5206\u522b\u8fdb\u884c\u76f4\u63a5\u63d2\u5165\u6392\u5e8f\uff0c\u5f85\u6574\u4e2a\u5e8f\u5217\u4e2d\u7684\u8bb0\u5f55\u201c\u57fa\u672c\u6709\u5e8f\u201d\u65f6\uff0c\u518d\u5bf9\u5168\u4f53\u8bb0\u5f55\u8fdb\u884c\u4e00\u6b21\u76f4\u63a5\u63d2\u5165\u6392\u5e8f<\/p>\n<p>\u7279\u70b9\uff1a<\/p>\n<ol start=\"\">\n<li>\u7f29\u5c0f\u589e\u91cf<\/li>\n<li>\u591a\u904d\u63d2\u5165\u6392\u5e8f<\/li>\n<\/ol>\n<p>\u4f8b\u5982\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/picture.chentaiyang.space\/202304251441939.png\" referrerpolicy=\"no-referrer\" alt=\"img\"><\/p>\n<p>&nbsp;<\/p>\n<p>\u601d\u8def\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/picture.chentaiyang.space\/202304251441938.png\" referrerpolicy=\"no-referrer\" alt=\"img\"><\/p>\n<p>&nbsp;<\/p>\n<p>\u7279\u70b9\uff1a<\/p>\n<ul>\n<li>\u4e00\u6b21\u79fb\u52a8\uff0c\u79fb\u52a8\u4f4d\u7f6e\u8f83\u5927\uff0c\u8df3\u8dc3\u5f0f\u5730\u63a5\u8fd1\u6392\u5e8f\u540e\u7684\u6700\u7ec8\u4f4d\u7f6e<\/li>\n<li>\u6700\u540e\u4e00\u6b21\u53ea\u9700\u8981\u5c11\u91cf\u79fb\u52a8<\/li>\n<li>\u589e\u91cf\u5e8f\u5217\u5fc5\u987b\u662f\u9012\u51cf\u7684\uff0c\u6700\u540e\u4e00\u4e2a\u5fc5\u987b\u662f1<\/li>\n<li>\u589e\u91cf\u5e8f\u5217\u5e94\u8be5\u662f\u4e92\u8d28\u7684<\/li>\n<\/ul>\n<pre><code class=\"language-cpp\" lang=\"cpp\">\/*******************************************************************************************************************************\n * @description\uff1a\u5e0c\u5c14\u6392\u5e8f\n * @param\uff1aL\n *\/\nvoid shellSort(sequenList&amp; L)\n{\n\tint i, j, increment;\n\tincrement = L.length;\n\tdo {\n\t\tincrement = increment \/ 3 + 1;\n\t\tfor (i = increment + 1; i &lt;= L.length; i++) {\n\t\t\tif (L.r[i].key &lt; L.r[i - increment].key) {\n\t\t\t\tL.r[0] = L.r[i];\n\t\t\t\tfor (j = i - increment; j &gt; 0 &amp;&amp; L.r[0].key &lt; L.r[j].key; j -= increment) {\n\t\t\t\t\tL.r[j + increment] = L.r[j];\n\t\t\t\t}\n\t\t\t\tL.r[j + increment] = L.r[0];\n\t\t\t}\n\t\t}\n\t} while (increment &gt; 1);\n}\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p>\u7b97\u6cd5\u5206\u6790\uff1a<\/p>\n<ul>\n<li>\u65f6\u95f4\u590d\u6742\u5ea6\u662fn\u548cd\u7684\u51fd\u6570\uff1aO(n^1.25) ~O(1.6n^1.25)\u2014\u2014\u7ecf\u9a8c\u516c\u5f0f<\/li>\n<li>\u7a7a\u95f4\u590d\u6742\u5ea6\u4e3aO(1)<\/li>\n<li>\u662f\u4e00\u79cd\u4e0d\u7a33\u5b9a\u7684\u6392\u5e8f\u65b9\u6cd5<\/li>\n<li>\u5982\u4f55\u9009\u62e9\u6700\u4f73d\u5e8f\u5217\uff0c\u76ee\u524d\u5c1a\u4e3a\u89e3\u51b3<\/li>\n<li>\u6700\u540e\u4e00\u4e2a\u589e\u91cf\u503c\u5fc5\u987b\u4e3a1\uff0c\u65e0\u9664\u4e861\u4e4b\u5916\u7684\u516c\u56e0\u5b50<\/li>\n<li>\u4e0d\u5b9c\u5728\u94fe\u5f0f\u5b58\u50a8\u7ed3\u6784\u4e0a\u5b9e\u73b0<\/li>\n<\/ul>\n<h2>8.3 \u4ea4\u6362\u6392\u5e8f<\/h2>\n<p><img decoding=\"async\" src=\"https:\/\/picture.chentaiyang.space\/202304251441942.png\" referrerpolicy=\"no-referrer\" alt=\"img\"><\/p>\n<p>&nbsp;<\/p>\n<h3>8.3.1 \u5192\u6ce1\u6392\u5e8f<\/h3>\n<p>\u57fa\u4e8e\u7b80\u5355\u7684\u4ea4\u6362\u601d\u60f3<\/p>\n<p>\u57fa\u672c\u601d\u60f3\uff1a\u6bcf\u8eba\u4e0d\u65ad\u5c06\u8bb0\u5f55\u4e24\u4e24\u6bd4\u8f83\uff0c\u5e76\u6309\u201c\u524d\u5c0f\u540e\u5927\u201d\u89c4\u5219\u4ea4\u6362<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/picture.chentaiyang.space\/202304251441947.png\" referrerpolicy=\"no-referrer\" alt=\"img\"><\/p>\n<pre><code class=\"language-cpp\" lang=\"cpp\">\/*******************************************************************************************************************************\n * @description\uff1a\u5192\u6ce1\u6392\u5e8f\n * @param\uff1aL\n *\/\nvoid bubbleSort(sequenList&amp; L)\n{\n\tint i, j;\n\trecordType temp;\n\t\/\/ \u5916\u5c42\u5faa\u73af\u63a7\u5236\u6bd4\u8f83\u7684\u8d9f\u6570\n\tfor (i = 1; i &lt;= L.length - 1; i++) {\n\t\t\/\/ \u5185\u5c42\u5faa\u73af\u63a7\u5236\u6bcf\u8d9f\u6bd4\u8f83\u7684\u6b21\u6570\n\t\tfor (j = 1; j &lt;= L.length - i; j++) {\n\t\t\tif (L.r[j].key &lt; L.r[j + 1].key) {\n\t\t\t\t\/\/ \u4ea4\u6362\n\t\t\t\ttemp = L.r[j];\n\t\t\t\tL.r[j] = L.r[j + 1];\n\t\t\t\tL.r[j + 1] = temp;\n\t\t\t}\n\t\t}\n\t}\n}\n<\/code><\/pre>\n<p>\u4f18\u70b9\uff1a\u6bcf\u8eba\u7ed3\u675f\u65f6\uff0c\u4e0d\u4ec5\u80fd\u6324\u51fa\u4e00\u4e2a\u6700\u5927\u503c\u5230\u6700\u540e\u9762\u4f4d\u7f6e\uff0c\u8fd8\u80fd\u540c\u65f6\u90e8\u5206\u7406\u987a\u5176\u5b83\u5143\u7d20<\/p>\n<p>&nbsp;<\/p>\n<p>\u5982\u4f55\u63d0\u9ad8\u6548\u7387\uff1f<\/p>\n<p>\u4e00\u65e6\u67d0\u4e00\u8d9f\u6bd4\u8f83\u65f6\u4e0d\u51fa\u73b0\u8bb0\u5f55\u4ea4\u6362\uff0c\u8bf4\u660e\u5df2\u7ecf\u6392\u597d\u5e8f\u4e86\uff0c\u5c31\u53ef\u4ee5\u7ed3\u675f\u672c\u7b97\u6cd5<\/p>\n<pre><code class=\"language-cpp\" lang=\"cpp\">\/*******************************************************************************************************************************\n * @description\uff1a\u5192\u6ce1\u6392\u5e8f\n * @param\uff1aL\n *\/\nvoid bubbleSort(sequenList&amp; L)\n{\n\tint i, j;\n\trecordType temp;\n\tint flag = 1;\t\/\/ \u7528\u4e8e\u6807\u8bb0\u662f\u5426\u53d1\u751f\u4ea4\u6362\n\n\t\/\/ \u5916\u5c42\u5faa\u73af\u63a7\u5236\u6bd4\u8f83\u7684\u8d9f\u6570\n\tfor (i = 1; i &lt;= L.length - 1 &amp;&amp; flag == 1; i++) {\n\t\tflag = 0;\n\t\t\/\/ \u5185\u5c42\u5faa\u73af\u63a7\u5236\u6bcf\u8d9f\u6bd4\u8f83\u7684\u6b21\u6570\n\t\tfor (j = 1; j &lt;= L.length - i; j++) {\n\t\t\tif (L.r[j].key &lt; L.r[j + 1].key) {\n\t\t\t\tflag = 1;\t\/\/ \u53d1\u751f\u4ea4\u6362,\u6807\u8bb0\u4e3a1;\u82e5\u672c\u8d9f\u6ca1\u53d1\u751f\u4ea4\u6362\uff0cflag\u4fdd\u6301\u4e3a0\n\t\t\t\t\/\/ \u4ea4\u6362\n\t\t\t\ttemp = L.r[j];\n\t\t\t\tL.r[j] = L.r[j + 1];\n\t\t\t\tL.r[j + 1] = temp;\n\t\t\t}\n\t\t}\n\t}\n}\n<\/code><\/pre>\n<p>\u65f6\u95f4\u590d\u6742\u5ea6\uff1a<\/p>\n<ul>\n<li>\u6700\u597d\u60c5\u51b5\uff08\u6b63\u5e8f\uff09\n<ul>\n<li>\u6bd4\u8f83\u6b21\u6570\uff1an-1<\/li>\n<li>\u79fb\u52a8\u6b21\u6570\uff1a0<\/li>\n<\/ul>\n<\/li>\n<li>\u6700\u574f\u60c5\u51b5\uff08\u9006\u5e8f\uff09\n<ul>\n<li>\u6bd4\u8f83\u6b21\u6570\uff1a<img decoding=\"async\" src=\"https:\/\/picture.chentaiyang.space\/202304251441951.svg\" referrerpolicy=\"no-referrer\" alt=\"img\"><\/li>\n<li>\u79fb\u52a8\u6b21\u6570\uff1a<img decoding=\"async\" src=\"https:\/\/picture.chentaiyang.space\/202304251441575.svg\" referrerpolicy=\"no-referrer\" alt=\"img\"><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>\u7b97\u6cd5\u8bc4\u4ef7\uff1a<\/p>\n<ul>\n<li>\u65f6\u95f4\u590d\u6742\u5ea6\uff1aO(n^2)<\/li>\n<li>\u7a7a\u95f4\u590d\u6742\u5ea6\uff1aO(1)<\/li>\n<li>\u662f\u7a33\u5b9a<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h3>8.3.2 \u5feb\u901f\u6392\u5e8f<\/h3>\n<p>\u57fa\u672c\u601d\u60f3\uff1a<\/p>\n<ul>\n<li>\u4efb\u53d6\u4e00\u4e2a\u5143\u7d20\uff08\u5982\uff1a\u7b2c\u4e00\u4e2a\uff09<strong>\u4e3a\u4e2d\u5fc3<\/strong><\/li>\n<li>\u6240\u6709\u6bd4\u5b83<strong>\u5c0f<\/strong>\u7684\u5143\u7d20\u4e00\u5f8b\u524d\u653e\uff0c\u6bd4\u5b83<strong>\u5927<\/strong>\u7684\u5143\u7d20\u4e00\u5f8b\u540e\u653e\uff0c\u5f62\u6210\u5de6\u53f3\u4e24\u4e2a\u5b50\u8868<\/li>\n<li>\u5bf9\u5404\u5b50\u8868\u91cd\u65b0\u9009\u62e9\u4e2d\u5fc3\u5143\u7d20\u5e76<strong>\u4f9d\u6b21\u89c4\u5219\u8c03\u6574\t\uff08\u9012\u5f52\uff09<\/strong><\/li>\n<li>\u76f4\u5230\u6bcf\u4e2a\u5b50\u8868\u7684\u5143\u7d20<strong>\u53ea\u5269\u4e00\u4e2a<\/strong><\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"https:\/\/picture.chentaiyang.space\/202304251441579.png\" referrerpolicy=\"no-referrer\" alt=\"img\"><\/p>\n<pre><code class=\"language-cpp\" lang=\"cpp\">\/*******************************************************************************************************************************\n * @description\uff1a\u83b7\u53d6\u4e2d\u8f74\n * @param\uff1aL\n * @param\uff1alow\n * @param\uff1ahigh\n * @return\uff1a\n *\/\nint partition(sequenList&amp; L, int low, int high)\n{\n\tL.r[0] = L.r[low];\n\tint pivotkey = L.r[low].key;\n\twhile (low &lt; high) {\n\t\twhile (low &lt; high &amp;&amp; L.r[high].key &gt;= pivotkey) {\n\t\t\thigh--;\n\t\t}\n\t\tL.r[low] = L.r[high];\n\t\twhile (low &lt; high &amp;&amp; L.r[low].key &lt;= pivotkey) {\n\t\t\tlow++;\n\t\t}\n\t\tL.r[high] = L.r[low];\n\t}\n\tL.r[low] = L.r[0];\n\treturn low;\n}\n\n\n\n\n\n\n\/*******************************************************************************************************************************\n * @description\uff1a\u5feb\u901f\u6392\u5e8f\n * @param\uff1aL\n * @param\uff1alow\n * @param\uff1ahigh\n *\/\nvoid quickSort(sequenList&amp; L, int low, int high)\n{\n\tif (low &lt; high) {\n\t\t\/\/ \u5c06\u8868\u4e00\u5206\u4e3a\u4e8c\n\t\tint pivotloc = partition(L, low, high);\n\t\t\/\/ \u9012\u5f52\u5bf9\u4f4e\u5b50\u8868\u9012\u5f52\u6392\u5e8f\n\t\tquickSort(L, low, pivotloc - 1);\n\t\t\/\/ \u9012\u5f52\u5bf9\u9ad8\u5b50\u8868\u9012\u5f52\u6392\u5e8f\n\t\tquickSort(L, pivotloc + 1, high);\n\t}\n}\n<\/code><\/pre>\n<p>\u65f6\u95f4\u590d\u6742\u5ea6\uff1a<\/p>\n<ul>\n<li>quickSort()\uff1aO(logn)<\/li>\n<li>partition()\uff1aO(n)<\/li>\n<\/ul>\n<p>\u7a7a\u95f4\u590d\u6742\u5ea6\uff1a<\/p>\n<p>\u5feb\u901f\u6392\u5e8f\u4e0d\u662f\u539f\u5730\u6392\u5e8f\uff0c\u7531\u4e8e\u7a0b\u5e8f\u4e2d\u4f7f\u7528\u4e86\u9012\u5f52\uff0c\u9700\u8981\u9012\u5f52\u8c03\u7528\u6808\u7684\u652f\u6301\uff0c\u800c\u6808\u7684\u957f\u5ea6\u53d6\u51b3\u4e8e\u9012\u5f52\u8c03\u7528\u7684\u6df1\u5ea6<\/p>\n<ul>\n<li>\u5728\u5e73\u5747\u60c5\u51b5\u4e0b\uff1a\u9700\u8981O(logn)\u7684\u6808\u7a7a\u95f4<\/li>\n<li>\u6700\u574f\u60c5\u51b5\u4e0b\uff1a\u6808\u7a7a\u95f4\u53ef\u8fbeO(n)<\/li>\n<\/ul>\n<p>\u7a33\u5b9a\u6027\uff1a<\/p>\n<ul>\n<li>\u5feb\u901f\u6392\u5e8f\u662f\u4e00\u79cd\u4e0d\u7a33\u5b9a\u7684\u6392\u5e8f\u65b9\u6cd5<\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"https:\/\/picture.chentaiyang.space\/202304251441581.png\" referrerpolicy=\"no-referrer\" alt=\"img\"><\/p>\n<p>&nbsp;<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/picture.chentaiyang.space\/202304251441586.png\" referrerpolicy=\"no-referrer\" alt=\"img\"><\/p>\n<p>&nbsp;<\/p>\n<p>\u7b97\u6cd5\u5206\u6790\uff1a<\/p>\n<ul>\n<li><strong>\u5212\u5206\u5143\u7d20\u7684\u9009\u53d6<\/strong>\u662f\u5f71\u54cd\u65f6\u95f4\u6027\u80fd\u7684\u5173\u952e<\/li>\n<li>\u8f93\u5165\u6570\u636e\u6b21\u5e8f\u8d8a\u4e71\uff0c\u6240\u9009\u5212\u5206\u5143\u7d20\u503c\u7684\u968f\u673a\u6027\u8d8a\u597d\uff0c\u6392\u5e8f\u901f\u5ea6\u8d8a\u5feb\uff0c\u5feb\u901f\u6392\u5e8f<strong>\u4e0d\u662f\u81ea\u7136\u6392\u5e8f<\/strong>\u65b9\u6cd5<\/li>\n<li>\u6539\u53d8\u5212\u5206\u5143\u7d20\u7684\u9009\u53d6\u60c5\u51b5\uff0c\u81f3\u591a\u53ea\u80fd\u6539\u53d8\u7b97\u6cd5\u5e73\u5747\u60c5\u51b5\u4e0b\u7684\u65f6\u95f4\u6027\u80fd\uff0c\u65e0\u6cd5\u6539\u53d8\u6700\u574f\u60c5\u51b5\u4e0b\u7684\u65f6\u95f4\u6027\u80fd\u3002\u5373\u65f6\u6700\u574f\u60c5\u51b5\u4e0b\uff0c\u5feb\u901f\u6392\u5e8f\u7684\u65f6\u95f4\u590d\u6742\u6027\u603b\u662fO(n^2)<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h2>8.4 \u9009\u62e9\u6392\u5e8f<\/h2>\n<h3>8.4.1 \u7b80\u5355\u9009\u62e9\u6392\u5e8f<\/h3>\n<p>\u57fa\u672c\u601d\u60f3\uff1a\u5728\u5f85\u6392\u5e8f\u7684\u6570\u636e\u4e2d\u9009\u51fa\u6700\u5927\uff08\u5c0f\uff09\u7684\u5143\u7d20\u653e\u5728\u5176\u6700\u7ec8\u7684\u4f4d\u7f6e<\/p>\n<p>&nbsp;<\/p>\n<p>\u57fa\u672c\u64cd\u4f5c\uff1a<\/p>\n<ol start=\"\">\n<li>\u9996\u5148\u901a\u8fc7<strong>n-1<\/strong>\u6b21\u5173\u952e\u5b57\u6bd4\u8f83\uff0c\u4ece<strong>n<\/strong>\u4e2a\u8bb0\u5f55\u4e2d\u627e\u51fa\u5173\u952e\u5b57\u6700\u5c0f\u7684\u8bb0\u5f55\uff0c\u5c06\u5b83\u4e0e\u7b2c\u4e00\u4e2a\u8bb0\u5f55\u4ea4\u6362<\/li>\n<li>\u518d\u901a\u8fc7<strong>n-2<\/strong>\u6b21\u6bd4\u8f83\uff0c\u4ece\u5269\u4f59\u7684<strong>n-1<\/strong>\u4e2a\u8bb0\u5f55\u4e2d\u627e\u51fa\u5173\u952e\u5b57\u6b21\u5c0f\u7684\u8bb0\u5f55\uff0c\u5c06\u5b83\u4e0e\u7b2c\u4e8c\u4e2a\u8bb0\u5f55\u4ea4\u6362<\/li>\n<li>\u91cd\u590d\u4e0a\u8ff0\u64cd\u4f5c\uff0c\u5171\u8fdb\u884c<strong>n-1<\/strong>\u8d9f\u6392\u5e8f\u540e\uff0c\u6392\u5e8f\u7ed3\u675f<\/li>\n<\/ol>\n<pre><code class=\"language-cpp\" lang=\"cpp\">\/*******************************************************************************************************************************\n * @description\uff1a\u7b80\u5355\u9009\u62e9\u6392\u5e8f\n * @param\uff1aL\n *\/\nvoid simpleSelectionSort(sequenList&amp; L)\n{\n\tint i, j, min;\n\tfor (i = 1; i &lt; L.length; i++) {\n\t\tmin = i;\n\t\tfor (j = i + 1; j &lt;= L.length; j++) {\n\t\t\tif (L.r[j].key &lt; L.r[min].key) {\n                \/\/ \u8bb0\u5f55\u6700\u5c0f\u503c\u7684\u4f4d\u7f6e\n\t\t\t\tmin = j;\n\t\t\t}\n\t\t}\n\t\tif (min != i) {\n\t\t\tswap(L.r[i], L.r[min]);\n\t\t}\n\t}\n}\n<\/code><\/pre>\n<p>\u65f6\u95f4\u590d\u6742\u5ea6\uff1aO(n^2)<\/p>\n<p>\u7b80\u5355\u9009\u62e9\u6392\u5e8f\u662f<strong>\u4e0d\u7a33\u5b9a<\/strong>\u6392\u5e8f<\/p>\n<p>&nbsp;<\/p>\n<h3>8.4.2 \u5806\u6392\u5e8f<\/h3>\n<p>\u5806\u7684\u5b9a\u4e49<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/picture.chentaiyang.space\/202304251441590.png\" referrerpolicy=\"no-referrer\" alt=\"img\"><\/p>\n<p>&nbsp;<\/p>\n<p>\u5806\u6392\u5e8f<\/p>\n<p>\u82e5\u5728\u8f93\u51fa<strong>\u5806\u9876<\/strong>\u7684\u6700\u5c0f\u503c\uff08\u6700\u5927\u503c\uff09\u540e\uff0c\u4f7f\u5f97\u5269\u4f59 n-1 \u4e2a\u5143\u7d20\u7684\u5e8f\u5217\u91cd\u53c8\u5efa\u6210\u4e00\u4e2a\u5806\uff0c\u5219\u5f97\u5230 n \u4e2a\u5143\u7d20\u7684\u6b21\u5c0f\u503c\uff08\u6b21\u5927\u503c\uff09.\u2026\u5982\u6b64\u53cd\u590d\uff0c\u4fbf\u80fd\u5f97\u5230\u4e00\u4e2a\u6709\u5e8f\u5e8f\u5217\uff0c\u8fd9\u4e2a\u8fc7\u7a0b\u79f0\u4e4b\u4e3a<strong>\u5806\u6392\u5e8f<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>\u5b9e\u73b0\u5806\u6392\u5e8f\u9700\u89e3\u51b3\u4e24\u4e2a\u95ee\u9898\uff1a<\/p>\n<ol start=\"\">\n<li>\u5982\u4f55\u7531\u4e00\u4e2a\u65e0\u5e8f\u5e8f\u5217\u5efa\u6210\u4e00\u4e2a\u5806\uff1f<\/li>\n<li>\u5982\u4f55\u5728\u8f93\u51fa\u5806\u9876\u5143\u7d20\u540e\uff0c\u8c03\u6574\u5269\u4f59\u5143\u7d20\u4e3a\u4e00\u4e2a\u65b0\u7684\u5806\uff1f<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<h4>\u5806\u7684\u8c03\u6574<\/h4>\n<p>\u5982\u4f55\u5728\u8f93\u51fa\u5806\u9876\u5143\u7d20\u540e\uff0c\u8c03\u6574\u5269\u4f59\u5143\u7d20\u4e3a\u4e00\u4e2a\u65b0\u7684\u5806\uff1f<\/p>\n<p>\u5c0f\u6839\u5806\uff1a<\/p>\n<ol start=\"\">\n<li>\u8f93\u51fa\u5806\u9876\u5143\u7d20\u4e4b\u540e\uff0c\u4ee5\u5806\u4e2d<strong>\u6700\u540e\u4e00\u4e2a\u5143\u7d20\u66ff\u4ee3\u4e4b<\/strong><\/li>\n<li>\u7136\u540e\u5c06\u6839\u7ed3\u70b9\u503c\u4e0e\u5de6\u3001\u53f3\u5b50\u6811\u7684\u6839\u7ed3\u70b9\u503c\u8fdb\u884c\u6bd4\u8f83\uff0c\u5e76\u4e8e\u5176\u4e2d<strong>\u5c0f\u8005<\/strong>\u8fdb\u884c<strong>\u4ea4\u6362<\/strong><\/li>\n<li>\u91cd\u590d\u4e0a\u8ff0\u64cd\u4f5c\uff0c\u76f4\u81f3\u53f6\u5b50\u7ed3\u70b9\uff0c\u5c06\u5f97\u5230\u65b0\u7684\u5806\uff0c\u79f0\u8fd9\u4e2a\u4ece\u5806\u9876\u81f3\u53f6\u5b50\u7684\u8c03\u6574\u8fc7\u7a0b\u4e3a<strong>\u201c\u7b5b\u9009\u201d<\/strong><\/li>\n<\/ol>\n<pre><code class=\"language-cpp\" lang=\"cpp\">\/*******************************************************************************************************************************\n * @description\uff1a\u5806\u7684\u8c03\u6574\n * @param\uff1aL\n * @param\uff1as\n * @param\uff1am\n *\/\nvoid heapAdjust(sequenList&amp; L, int s, int m)\n{\n\tint j;\n\tL.r[0] = L.r[s];\n\tfor (j = 2 * s; j &lt;= m; j *= 2) {\n\t\tif (j &lt; m &amp;&amp; L.r[j].key &lt; L.r[j + 1].key) {\n\t\t\t++j;\n\t\t}\n\t\tif (L.r[0].key &gt;= L.r[j].key) {\n\t\t\tbreak;\n\t\t}\n\t\tL.r[s] = L.r[j];\n\t\ts = j;\n\t}\n\tL.r[s] = L.r[0];\n}\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p>\u53ef\u4ee5\u770b\u51fa\uff1a<\/p>\n<p>\u5bf9\u4e8e\u4e00\u4e2a\u65e0\u5e8f\u5e8f\u5217\u53cd\u590d<strong>\u201c\u7b5b\u9009\u201d<\/strong>\u5c31\u53ef\u4ee5\u5f97\u5230\u4e00\u4e2a\u5806\uff1b\u5373\uff1a\u4ece\u4e00\u4e2a\u65e0\u5e8f\u5e8f\u5217\u5efa\u5806\u7684\u8fc7\u7a0b\u5c31\u662f\u4e00\u4e2a<strong>\u53cd\u590d\u201c\u7b5b\u9009\u201d<\/strong>\u7684\u8fc7\u7a0b<\/p>\n<p>&nbsp;<\/p>\n<h4>\u5806\u7684\u5efa\u7acb<\/h4>\n<p>\u5728\u5b8c\u5168\u4e8c\u53c9\u6811\u4e2d\u6240\u6709\u4ee5\u53f6\u5b50\u7ed3\u70b9\uff08\u5e8f\u53f7 i&gt;n\/2\uff09\u4e3a\u6839\u7684\u5b50\u6811\u662f\u5806\u3002\u8fd9\u6837\uff0c\u6211\u4eec\u53ea\u9700\u4f9d\u6b21\u5c06\u4ee5\u5e8f\u53f7\u4e3a n\/2\uff0cn\/2-1\uff0c&#8230;&#8230;\uff0c1\u7684\u7ed3\u70b9\u4e3a\u6839\u7684\u5b50\u6811\u5747\u8c03\u6574\u4e3a\u5806\u5373\u53ef<\/p>\n<p>\u5373\uff1a\u5bf9\u5e94\u7531n\u4e2a\u5143\u7d20\u7ec4\u6210\u7684\u65e0\u5e8f\u5e8f\u5217\uff0c\u201c\u7b5b\u9009\u201d\u53ea\u9700\u4ece\u7b2cn\/2\u4e2a\u5143\u7d20\u5f00\u59cb<\/p>\n<pre><code class=\"language-cpp\" lang=\"cpp\">\/*******************************************************************************************************************************\n * @description\uff1a\u5806\u7684\u5efa\u7acb\n * @param\uff1aL\n *\/\nvoid heapCreate(sequenList&amp; L)\n{\n\tint i;\n\tfor (i = L.length \/ 2; i &gt; 0; i--) {\n\t\theapAdjust(L, i, L.length);\n\t}\n}\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p>\u7531\u4ee5\u4e0a\u5206\u6790\u77e5\uff1a<\/p>\n<p>\u82e5\u5bf9\u4e00\u4e2a\u65e0\u5e8f\u5e8f\u5217\u5efa\u5806\uff0c\u7136\u540e\u8f93\u51fa\u6839\uff1b\u91cd\u590d\u8be5\u8fc7\u7a0b\u5c31\u53ef\u4ee5\u7531\u4e00\u4e2a\u65e0\u5e8f\u5e8f\u5217\u8f93\u51fa\u4e3a\u6709\u5e8f\u5e8f\u5217<\/p>\n<p>\u5b9e\u8d28\u4e0a\uff0c\u5806\u6392\u5e8f\u5c31\u662f\u5229\u7528\u5b8c\u5168\u4e8c\u53c9\u6811\u4e2d\u7236\u8282\u70b9\u4e0e\u5b69\u5b50\u7ed3\u70b9\u4e4b\u95f4\u7684\u5185\u5728\u5173\u7cfb\u6765\u6392\u5e8f\u7684<\/p>\n<pre><code class=\"language-cpp\" lang=\"cpp\">\/*******************************************************************************************************************************\n * @description\uff1a\u5806\u6392\u5e8f\n * @param\uff1aL\n *\/\nvoid heapSort(sequenList&amp; L)\n{\n\tint i;\n\theapCreate(L);\t\/\/ \u5efa\u7acb\u521d\u59cb\u5806\n\tfor (i = L.length; i &gt; 1; i--) {\n\t\tswap(L.r[1], L.r[i]);\n\t\theapAdjust(L, 1, i - 1);\t\/\/ \u5c06\u5269\u4f59\u7684i-1\u4e2a\u5143\u7d20\u6574\u7406\u6210\u5806\n\t}\n}\n<\/code><\/pre>\n<p>\u65f6\u95f4\u590d\u6742\u5ea6\uff1aO(nlogn)<\/p>\n<ul>\n<li>\u5806\u6392\u5e8f\u7684\u65f6\u95f4\u4e3b\u8981\u8017\u8d39\u5728\u5efa\u521d\u59cb\u5806\u548c\u8c03\u6574\u5efa\u65b0\u5806\u65f6\u8fdb\u884c\u7684\u53cd\u590d\u7b5b\u9009\u4e0a\u3002\u5806\u6392\u5e8f\u5728\u6700\u574f\u6e05\u51b5\u4e0b\uff0c\u5176\u65f6\u95f4\u590d\u6742\u5ea6\u4e5f\u4e3aO(nlogn)\uff0c\u8fd9\u662f\u5806\u6392\u5e8f\u7684\u6700\u5927\u4f18\u70b9\u3002\u65e0\u8bba\u5f85\u6392\u5e8f\u5217\u4e2d\u7684\u8bb0\u5f55\u662f\u6b63\u5e8f\u8fd8\u662f\u9006\u5e8f\u6392\u5217\uff0c\u90fd\u4e0d\u4f1a\u4f7f\u5806\u6392\u5e8f\u5904\u4e8e\u201c\u6700\u597d\u201d\u6216\u201c\u6700\u574f\u201d\u7684\u72b6\u6001\u3002<\/li>\n<li>\u53e6\u5916\uff0c\u5806\u6392\u5e8f\u4ec5\u9700\u4e00\u4e2a\u8bb0\u5f55\u4f9b\u4ea4\u6362\u7528\u7684\u8f85\u52a9\u5b58\u50a8\u7a7a\u95f4<\/li>\n<li>\u7136\u800c\u5806\u6392\u5e8f\u662f\u4e00\u79cd\u4e0d\u7a33\u5b9a\u7684\u6392\u5e8f\u65b9\u6cd5\uff0c\u5b83\u4e0d\u9002\u7528\u4e8e\u5f85\u6392\u5e8f\u8bb0\u5f55\u4e2a\u6570n\u8f83\u5c11\u7684\u60c5\u51b5\uff0c\u4f46\u5bf9\u4e8en\u8f83\u5927\u7684\u6587\u4ef6\u8fd8\u662f\u5f88\u6709\u6548\u7684<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h2>8.5 \u5f52\u5e76\u6392\u5e8f<\/h2>\n<p>\u57fa\u672c\u601d\u60f3\uff1a\u5c06\u4e24\u4e2a\u6216\u4e24\u4e2a\u4ee5\u4e0a\u7684\u6709\u5e8f\u5b50\u5e8f\u5217\u201c\u5f52\u5e76\u201d\u4e3a\u4e00\u4e2a\u6709\u5e8f\u5e8f\u5217<\/p>\n<p>\u5728\u5185\u90e8\u6392\u5e8f\u4e2d\uff0c\u901a\u5e38\u91c7\u7528\u7684\u662f2-\u8def\u5f52\u5e76\u6392\u5e8f\u3002\u5373\uff1a\u5c06\u4e24\u4e2a\u4f4d\u7f6e\u76f8\u90bb\u7684\u6709\u5e8f\u5b50\u5e8f\u5217R[l&#8230;m]\u548cR[m+1&#8230;n]\u5f52\u5e76\u4e3a\u4e00\u4e2a\u6709\u5e8f\u5e8f\u5217R[l&#8230;n]<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/picture.chentaiyang.space\/202304251441596.png\" referrerpolicy=\"no-referrer\" alt=\"img\"><\/p>\n<p>&nbsp;<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/picture.chentaiyang.space\/202304251441718.png\" referrerpolicy=\"no-referrer\" alt=\"img\"><\/p>\n<p>&nbsp;<\/p>\n<p>\u7b97\u6cd5\u5206\u6790\uff1a<\/p>\n<ul>\n<li>\u65f6\u95f4\u6548\u7387\uff1aO(nlogn)<\/li>\n<li>\u7a7a\u95f4\u6548\u7387\uff1aO(n)<\/li>\n<li>\u7a33\u5b9a<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h2>8.6 \u57fa\u6570\u6392\u5e8f<\/h2>\n<p>\u57fa\u672c\u601d\u60f3\uff1a<strong>\u5206\u914d+\u6536\u96c6<\/strong><\/p>\n<p>\u4e5f\u53eb<strong>\u6876\u6392\u5e8f<\/strong>\u6216<strong>\u7bb1\u6392\u5e8f<\/strong>\uff1a\u8bbe\u7f6e\u82e5\u5e72\u4e2a\u7bb1\u5b50\uff0c\u5c06\u5173\u952e\u5b57\u4e3ak\u7684\u8bb0\u5f55\u653e\u5165\u7b2ck\u4e2a\u7bb1\u5b50\uff0c\u7136\u540e\u5728\u6309\u5e8f\u53f7\u5c06\u975e\u7a7a\u7684\u8fde\u63a5<\/p>\n<p>\u57fa\u6570\u6392\u5e8f\uff1a\u6570\u5b57\u662f\u6709\u8303\u56f4\u7684\uff0c\u5747\u75310-9\u4e2a\u5341\u4e2a\u6570\u5b57\u7ec4\u6210\uff0c\u5219\u53ea\u9700\u8bbe\u7f6e\u5341\u4e2a\u7bb1\u5b50\uff0c\u76f8\u7ee7\u6309\u4e2a\u3001\u5341\u3001\u767e\u2026\u2026\u8fdb\u884c\u6392\u5e8f<\/p>\n<p>&nbsp;<\/p>\n<p>\u65f6\u95f4\u6548\u7387\uff1aO(k*(n+m))<\/p>\n<ul>\n<li>k\uff1a\u5173\u952e\u5b57\u4e2a\u6570<\/li>\n<li>m\uff1a\u5173\u952e\u5b57\u53d6\u503c\u8303\u56f4\u4e3am\u4e2a\u503c<\/li>\n<\/ul>\n<p>\u7a7a\u95f4\u6548\u7387\uff1aO(n+m)<\/p>\n<p>\u7a33\u5b9a\u6027\uff1a\u7a33\u5b9a<\/p>\n<p>&nbsp;<\/p>\n<h2>8.7 \u6392\u5e8f\u65b9\u6cd5\u7efc\u5408\u6bd4\u8f83<\/h2>\n<p>\u4e00\u3001\u65f6\u95f4\u6027\u80fd\uff1a<\/p>\n<ol start=\"\">\n<li>\u6309\u5e73\u5747\u7684\u65f6\u95f4\u6027\u80fd\u6765\u5206\uff0c\u6709\u4e09\u7c7b\u6392\u5e8f\u65b9\u6cd5\uff1a\n<ol>\n<li>\u65f6\u95f4\u590d\u6742\u5ea6\u4e3a<strong>O(nlogn)<\/strong>\u7684\u65b9\u6cd5\u6709\uff1a\n<ol>\n<li>\u5feb\u901f\u6392\u5e8f\u3001\u5806\u6392\u5e8f\u548c\u5f52\u5e76\u6392\u5e8f\uff0c\u5176\u4e2d\u5feb\u901f\u6392\u5e8f\u4e3a\u6700\u597d<\/li>\n<\/ol>\n<\/li>\n<li>\u65f6\u95f4\u590d\u6742\u5ea6\u4e3a<strong>O(n^2)<\/strong>\u7684\u6709\uff1a\n<ol>\n<li>\u76f4\u63a5\u63d2\u5165\u6392\u5e8f\u3001\u5192\u6ce1\u6392\u5e8f\u548c\u7b80\u5355\u9009\u62e9\u6392\u5e8f\uff0c\u5176\u4e2d\u4ee5\u76f4\u63a5\u63d2\u5165\u4e3a\u6700\u597d\uff0c\u7279\u522b\u662f\u5bf9\u90a3\u4e9b\u5bf9\u5173\u952e\u5b57\u8fd1\u4f3c\u6709\u5e8f\u7684\u8bb0\u5f55\u5217\u5c24\u4e3a\u5982\u6b64<\/li>\n<\/ol>\n<\/li>\n<li>\u65f6\u95f4\u590d\u6742\u5ea6\u4e3a<strong>O(n)<\/strong>\u7684\u6392\u5e8f\u65b9\u6cd5\u53ea\u6709\uff1a\u57fa\u6570\u6392\u5e8f<\/li>\n<\/ol>\n<\/li>\n<li>\u5f53\u5f85\u6392\u8bb0\u5f55\u5e8f\u5217\u6309\u5173\u952e\u5b57\u987a\u5e8f\u6709\u5e8f\u65f6\uff0c\u76f4\u63a5\u63d2\u5165\u6392\u5e8f\u548c\u5192\u6ce1\u6392\u5e8f\u80fd\u8fbe\u5230O(n)\u7684\u65f6\u95f4\u590d\u6742\u5ea6\uff1b\u800c\u5bf9\u4e8e\u5feb\u901f\u6392\u5e8f\u800c\u8a00\uff0c\u8fd9\u662f\u6700\u4e0d\u597d\u7684\u60c5\u51b5\uff0c\u6b64\u65f6\u7684\u65f6\u95f4\u6027\u80fd\u9000\u5316\u4e3aO(n^2)\uff0c\u56e0\u6b64\u5e94\u8be5\u5c3d\u91cf\u907f\u514d\u7684\u60c5\u51b5<\/li>\n<li>\u7b80\u5355\u9009\u62e9\u6392\u5e8f\u3001\u5806\u6392\u5e8f\u548c\u5f52\u5e76\u6392\u5e8f\u7684\u65f6\u95f4\u6027\u80fd\u4e0d\u968f\u8bb0\u5f55\u5e8f\u5217\u4e2d\u5173\u952e\u5b57\u7684\u5206\u5e03\u800c\u6539\u53d8<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<p>\u4e8c\u3001\u7a7a\u95f4\u6027\u80fd\uff1a\u6307\u7684\u662f\u6392\u5e8f\u8fc7\u7a0b\u4e2d\u6240\u9700\u7684\u8f85\u52a9\u7a7a\u95f4\u7684\u5927\u5c0f<\/p>\n<ol start=\"\">\n<li>\u6240\u6709\u7684\u7b80\u5355\u6392\u5e8f\u65b9\u6cd5\uff08\u5305\u62ec\uff1a\u76f4\u63a5\u63d2\u5165\u3001\u5192\u6ce1\u548c\u7b80\u5355\u9009\u62e9\uff09\u548c\u5806\u6392\u5e8f\u7684\u7a7a\u95f4\u590d\u6742\u5ea6\u4e3aO(1)<\/li>\n<li>\u5feb\u901f\u6392\u5e8f\u4e3aO(logn)\uff0c\u4e3a\u6808\u6240\u9700\u7684\u8f85\u52a9\u7a7a\u95f4<\/li>\n<li>\u5f52\u5e76\u6392\u5e8f\u6240\u9700\u8f85\u52a9\u7a7a\u95f4\u6700\u591a\uff0c\u5176\u7a7a\u95f4\u590d\u6742\u5ea6\u4e3aO(n)<\/li>\n<li>\u94fe\u5f0f\u57fa\u6570\u6392\u5e8f\u9700\u9644\u8bbe\u961f\u5217\u9996\u5c3e\u6307\u9488\uff0c\u5219\u7a7a\u95f4\u590d\u6742\u5ea6\u4e3aO(rd)<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<p>\u4e09\u3001\u6392\u5e8f\u65b9\u6cd5\u7684\u7a33\u5b9a\u6027\u80fd<\/p>\n<ol start=\"\">\n<li>\u7a33\u5b9a\u7684\u6392\u5e8f\u65b9\u6cd5\u6307\u7684\u662f\uff0c\u5bf9\u4e8e\u4e24\u4e2a\u5173\u952e\u5b57\u76f8\u7b49\u7684\u8bb0\u5f55\uff0c\u5b83\u4eec\u5728\u5e8f\u5217\u4e2d\u7684\u76f8\u5bf9\u4f4d\u7f6e\uff0c\u5728\u6392\u5e8f\u4e4b\u524d\u548c\u7ecf\u8fc7\u6392\u5e8f\u4e4b\u540e\uff0c\u6ca1\u6709\u6539\u53d8\u3002<\/li>\n<li>\u5f53\u5bf9\u591a\u5173\u952e\u5b57\u7684\u8bb0\u5f55\u5e8f\u5217\u8fdb\u884cLSD\u65b9\u6cd5\u6392\u5e8f\u65f6\uff0c\u5fc5\u987b\u91c7\u7528\u7a33\u5b9a\u7684\u6392\u5e8f\u65b9\u6cd5\u3002<\/li>\n<li>\u5bf9\u4e8e\u4e0d\u7a33\u5b9a\u7684\u6392\u5e8f\u65b9\u6cd5\uff0c\u53ea\u8981\u80fd\u4e3e\u51fa\u4e00\u4e2a\u5b9e\u4f8b\u8bf4\u660e\u5373\u53ef\u3002<\/li>\n<li>\u5feb\u901f\u6392\u5e8f\u548c\u5806\u6392\u5e8f\u662f\u4e0d\u7a33\u5b9a\u7684\u6392\u5e8f\u65b9\u6cd5\u3002<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<h2>8.8 \u5199\u5728\u6700\u540e<\/h2>\n<p>\u5b8c\u6574\u4ee3\u7801\uff1a<a href=\"https:\/\/github.com\/kisstaiyang\/DataStruct\/tree\/main\/%E7%AC%AC8%E7%AB%A0-%E6%8E%92%E5%BA%8F\">\u6233\u6211\ud83c\udf39<\/a><\/p>\n<p>\u672c\u6587\u5b8c<\/p>\n<p>\u656c\u7231\u4e0e\u660e\u5929\ud83c\udf39<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u7ae0\u91cd\u70b9\uff1a\u4ea4\u6362\u6392\u5e8f\u3001\u5806\u6392\u5e8f<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[82,108,110,114,113,109,107,112,111],"class_list":["post-380","post","type-post","status-publish","format-standard","hentry","category-11","tag-ds","tag-108","tag-110","tag-114","tag-113","tag-109","tag-107","tag-112","tag-111"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u7b2c8\u7ae0-\u6392\u5e8f - #\u762b\u7537\u65e5\u8bb0<\/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:\/\/blog.taiyang.space\/?p=380\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u7b2c8\u7ae0-\u6392\u5e8f - #\u762b\u7537\u65e5\u8bb0\" \/>\n<meta property=\"og:description\" content=\"\u672c\u7ae0\u91cd\u70b9\uff1a\u4ea4\u6362\u6392\u5e8f\u3001\u5806\u6392\u5e8f\" \/>\n<meta property=\"og:url\" content=\"https:\/\/blog.taiyang.space\/?p=380\" \/>\n<meta property=\"og:site_name\" content=\"#\u762b\u7537\u65e5\u8bb0\" \/>\n<meta property=\"article:published_time\" content=\"2023-05-06T13:12:33+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-05-06T13:12:34+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/picture.chentaiyang.space\/202304251441144.png\" \/>\n<meta name=\"author\" content=\"taiyang\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"taiyang\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/blog.taiyang.space\/?p=380#article\",\"isPartOf\":{\"@id\":\"https:\/\/blog.taiyang.space\/?p=380\"},\"author\":{\"name\":\"taiyang\",\"@id\":\"https:\/\/blog.taiyang.space\/#\/schema\/person\/5e3b9567310d4c4a328573992325178c\"},\"headline\":\"\u7b2c8\u7ae0-\u6392\u5e8f\",\"datePublished\":\"2023-05-06T13:12:33+00:00\",\"dateModified\":\"2023-05-06T13:12:34+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/blog.taiyang.space\/?p=380\"},\"wordCount\":148,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/blog.taiyang.space\/#\/schema\/person\/5e3b9567310d4c4a328573992325178c\"},\"keywords\":[\"DS\",\"\u5192\u6ce1\u6392\u5e8f\",\"\u57fa\u6570\u6392\u5e8f\",\"\u5806\u6392\u5e8f\",\"\u5e0c\u5c14\u6392\u5e8f\",\"\u5feb\u901f\u6392\u5e8f\",\"\u6392\u5e8f\",\"\u76f4\u63a5\u63d2\u5165\u6392\u5e8f\",\"\u7b80\u5355\u9009\u62e9\u6392\u5e8f\"],\"articleSection\":[\"\u6570\u636e\u7ed3\u6784\"],\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/blog.taiyang.space\/?p=380#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/blog.taiyang.space\/?p=380\",\"url\":\"https:\/\/blog.taiyang.space\/?p=380\",\"name\":\"\u7b2c8\u7ae0-\u6392\u5e8f - #\u762b\u7537\u65e5\u8bb0\",\"isPartOf\":{\"@id\":\"https:\/\/blog.taiyang.space\/#website\"},\"datePublished\":\"2023-05-06T13:12:33+00:00\",\"dateModified\":\"2023-05-06T13:12:34+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/blog.taiyang.space\/?p=380#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/blog.taiyang.space\/?p=380\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/blog.taiyang.space\/?p=380#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/blog.taiyang.space\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u7b2c8\u7ae0-\u6392\u5e8f\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/blog.taiyang.space\/#website\",\"url\":\"https:\/\/blog.taiyang.space\/\",\"name\":\"#\u762b\u7537\u65e5\u8bb0\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/blog.taiyang.space\/#\/schema\/person\/5e3b9567310d4c4a328573992325178c\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/blog.taiyang.space\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/blog.taiyang.space\/#\/schema\/person\/5e3b9567310d4c4a328573992325178c\",\"name\":\"taiyang\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/blog.taiyang.space\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/blog.taiyang.space\/wp-content\/uploads\/2022\/10\/touxiang.jpg\",\"contentUrl\":\"https:\/\/blog.taiyang.space\/wp-content\/uploads\/2022\/10\/touxiang.jpg\",\"width\":612,\"height\":640,\"caption\":\"taiyang\"},\"logo\":{\"@id\":\"https:\/\/blog.taiyang.space\/#\/schema\/person\/image\/\"},\"sameAs\":[\"https:\/\/blog.taiyang.space\"],\"url\":\"https:\/\/blog.taiyang.space\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u7b2c8\u7ae0-\u6392\u5e8f - #\u762b\u7537\u65e5\u8bb0","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:\/\/blog.taiyang.space\/?p=380","og_locale":"zh_CN","og_type":"article","og_title":"\u7b2c8\u7ae0-\u6392\u5e8f - #\u762b\u7537\u65e5\u8bb0","og_description":"\u672c\u7ae0\u91cd\u70b9\uff1a\u4ea4\u6362\u6392\u5e8f\u3001\u5806\u6392\u5e8f","og_url":"https:\/\/blog.taiyang.space\/?p=380","og_site_name":"#\u762b\u7537\u65e5\u8bb0","article_published_time":"2023-05-06T13:12:33+00:00","article_modified_time":"2023-05-06T13:12:34+00:00","og_image":[{"url":"https:\/\/picture.chentaiyang.space\/202304251441144.png"}],"author":"taiyang","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"taiyang","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"4 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/blog.taiyang.space\/?p=380#article","isPartOf":{"@id":"https:\/\/blog.taiyang.space\/?p=380"},"author":{"name":"taiyang","@id":"https:\/\/blog.taiyang.space\/#\/schema\/person\/5e3b9567310d4c4a328573992325178c"},"headline":"\u7b2c8\u7ae0-\u6392\u5e8f","datePublished":"2023-05-06T13:12:33+00:00","dateModified":"2023-05-06T13:12:34+00:00","mainEntityOfPage":{"@id":"https:\/\/blog.taiyang.space\/?p=380"},"wordCount":148,"commentCount":0,"publisher":{"@id":"https:\/\/blog.taiyang.space\/#\/schema\/person\/5e3b9567310d4c4a328573992325178c"},"keywords":["DS","\u5192\u6ce1\u6392\u5e8f","\u57fa\u6570\u6392\u5e8f","\u5806\u6392\u5e8f","\u5e0c\u5c14\u6392\u5e8f","\u5feb\u901f\u6392\u5e8f","\u6392\u5e8f","\u76f4\u63a5\u63d2\u5165\u6392\u5e8f","\u7b80\u5355\u9009\u62e9\u6392\u5e8f"],"articleSection":["\u6570\u636e\u7ed3\u6784"],"inLanguage":"zh-Hans","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/blog.taiyang.space\/?p=380#respond"]}]},{"@type":"WebPage","@id":"https:\/\/blog.taiyang.space\/?p=380","url":"https:\/\/blog.taiyang.space\/?p=380","name":"\u7b2c8\u7ae0-\u6392\u5e8f - #\u762b\u7537\u65e5\u8bb0","isPartOf":{"@id":"https:\/\/blog.taiyang.space\/#website"},"datePublished":"2023-05-06T13:12:33+00:00","dateModified":"2023-05-06T13:12:34+00:00","breadcrumb":{"@id":"https:\/\/blog.taiyang.space\/?p=380#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blog.taiyang.space\/?p=380"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/blog.taiyang.space\/?p=380#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/blog.taiyang.space\/"},{"@type":"ListItem","position":2,"name":"\u7b2c8\u7ae0-\u6392\u5e8f"}]},{"@type":"WebSite","@id":"https:\/\/blog.taiyang.space\/#website","url":"https:\/\/blog.taiyang.space\/","name":"#\u762b\u7537\u65e5\u8bb0","description":"","publisher":{"@id":"https:\/\/blog.taiyang.space\/#\/schema\/person\/5e3b9567310d4c4a328573992325178c"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blog.taiyang.space\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":["Person","Organization"],"@id":"https:\/\/blog.taiyang.space\/#\/schema\/person\/5e3b9567310d4c4a328573992325178c","name":"taiyang","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/blog.taiyang.space\/#\/schema\/person\/image\/","url":"https:\/\/blog.taiyang.space\/wp-content\/uploads\/2022\/10\/touxiang.jpg","contentUrl":"https:\/\/blog.taiyang.space\/wp-content\/uploads\/2022\/10\/touxiang.jpg","width":612,"height":640,"caption":"taiyang"},"logo":{"@id":"https:\/\/blog.taiyang.space\/#\/schema\/person\/image\/"},"sameAs":["https:\/\/blog.taiyang.space"],"url":"https:\/\/blog.taiyang.space\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/blog.taiyang.space\/index.php?rest_route=\/wp\/v2\/posts\/380","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.taiyang.space\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.taiyang.space\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.taiyang.space\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.taiyang.space\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=380"}],"version-history":[{"count":1,"href":"https:\/\/blog.taiyang.space\/index.php?rest_route=\/wp\/v2\/posts\/380\/revisions"}],"predecessor-version":[{"id":381,"href":"https:\/\/blog.taiyang.space\/index.php?rest_route=\/wp\/v2\/posts\/380\/revisions\/381"}],"wp:attachment":[{"href":"https:\/\/blog.taiyang.space\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=380"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.taiyang.space\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=380"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.taiyang.space\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=380"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}