{"id":155,"date":"2021-01-22T23:53:28","date_gmt":"2021-01-22T15:53:28","guid":{"rendered":"https:\/\/fireinsect.top\/?p=155"},"modified":"2021-02-16T22:47:22","modified_gmt":"2021-02-16T14:47:22","slug":"%e9%80%92%e5%bd%92%e6%8e%92%e5%ba%8f%e6%b3%95-%e5%88%86%e6%b2%bb%e6%8e%92%e5%ba%8f","status":"publish","type":"post","link":"https:\/\/fireinsect.top\/index.php\/2021\/01\/22\/%e9%80%92%e5%bd%92%e6%8e%92%e5%ba%8f%e6%b3%95-%e5%88%86%e6%b2%bb%e6%8e%92%e5%ba%8f\/","title":{"rendered":"\u9012\u5f52\u6392\u5e8f\u6cd5&#8212;-\u5206\u6cbb\u6392\u5e8f"},"content":{"rendered":"\n<p>\u539f\u7406\uff1a<\/p>\n\n\n\n<p>\u5229\u7528\u4e8c\u5206\u6cd5\u5c06\u4e00\u7ec4\u6570\u7ec4\u5206\u6210n\u591a\u6bb5\u53ea\u6709\u4e00\u4e2a\u5143\u7d20\u7684\u6570\u7ec4\uff0c\u518d\u5c06\u6570\u7ec4\u4e24\u4e24\u7ec4\u5408\u6392\u5e8f<\/p>\n\n\n\n<p>\u524d\u63d0\uff1a<\/p>\n\n\n\n<p>\u8bbe\u7acb\u4e24\u4e2a\u51fd\u6570\uff0c\u4e00\u4e2a\u51fd\u6570\u7528\u4e8e\u5206\u5316\u6570\u7ec4\uff0c\u4e00\u4e2a\u51fd\u6570\u7528\u4e8e\u5408\u5e76\u6570\u7ec4\u7684\u9012\u5f52<\/p>\n\n\n\n<!--more-->\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"java\" class=\"language-java\">import java.io.*;\n import java.util.Arrays;\n class test  \n {\n     public static int[] paixu(int[] array){\n         \/\/\u7528\u4e8e\u9012\u5f52\u7684\u7ed3\u675f\u5373\u5206\u5316\u4e3a\u53ea\u6709\u4e00\u4e2a\u5143\u7d20\u7684\u6570\u7ec4\n         if(array.length==1){\n             return array;\n         }\n         int middle=array.length\/2;\n         \/\/\u5229\u7528\u5206\u5316\u51fd\u6570\u6765\u5b8c\u6210\u6570\u7ec4\u7684\u5de6\u53f3\u5206\u5316\n         int[] le=paixu(sor(0,middle,array));\n         int[] ri=paixu(sor(middle,array.length,array));\n         int i=0,j=0;\n         int index=0;\/\/\u8fd9\u91cc\u8bbe\u7acb\u4e86\u5750\u6807\u53d8\u91cf\u6765\u6574\u5408\u6570\u7ec4\n         while(i&lt;le.length&amp;&amp;j&lt;ri.length){\n                 array[index]=ri[j];\n                 j++;\n             }else{\n                 array[index]=le[i];\n                 i++;\n             }\n             index++;\n         }\/\/\u6b64\u65f6\u5faa\u73af\u7ed3\u675f\uff0c\u5982\u679c\u6ca1\u7528\u6574\u5408\u5b8c\u6210\u5219\u4ee3\u8868\u5de6\u53f3\u4e24\u4e2a\u6570\u7ec4\u6709\u4e00\u4e2a\u6570\u7ec4\u5df2\u7ecf\u904d\u5386\u5230\u5934\uff08while\u5224\u5b9a\u91cc\u6709\u4e00\u4e2a\u5df2\u7ecf\u4e0d\u6210\u7acb\u7684\uff09\uff0c\n        \/\/\u5728\u6b64\u57fa\u7840\u4e0b\u8fdb\u884c\u5206\u7c7b\u8ba8\u8bba\u5206\u7c7b\u8ba8\u8bba\uff08ps\uff1a\u6211\u611f\u89c9\u8fd9\u91cc\u662f\u6613\u5ffd\u89c6\u70b9\uff09\n         if(i&lt;le.length){\n             for(int n=i;n&lt;le.length;n++){\n                 array[index]=le[n];\n                 index++;\n             }\n         }\n         if(j&lt;ri.length){\n             for(int m=j;m&lt;ri.length;m++){\n                 array[index]=ri[m];\n                 index++;\n             }\n         }\n         return array;\n     }\n     \/\/\u7528\u4e8e\u5206\u5316\u6570\u7ec4\u7684\u51fd\u6570\n     public static int[] sor(int left,int right,int[] array){\n         int[] result=new int[right-left];\n         for(int i=0;left&lt;right;left++,i++){\n             result[i]=array[left];\n         }\n         return result;\n     }\n     public static void main (String[] args) throws java.lang.Exception\n     {\n         int[] m={1,9,78,5,2,3,44,65,26,78,3,6,1,2};\n         int[] p=paixu(m);\n         System.out.println(Arrays.toString(p));\n     }\n }<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u539f\u7406\uff1a \u5229\u7528\u4e8c\u5206\u6cd5\u5c06\u4e00\u7ec4\u6570\u7ec4\u5206\u6210n\u591a\u6bb5\u53ea\u6709\u4e00\u4e2a\u5143\u7d20\u7684\u6570\u7ec4\uff0c\u518d\u5c06\u6570\u7ec4\u4e24\u4e24\u7ec4\u5408\u6392\u5e8f \u524d\u63d0\uff1a \u8bbe\u7acb\u4e24\u4e2a\u51fd\u6570\uff0c\u4e00\u4e2a\u51fd\u6570 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","footnotes":""},"categories":[1,7],"tags":[],"class_list":["post-155","post","type-post","status-publish","format-standard","hentry","category-wcd","category-7"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/fireinsect.top\/index.php\/wp-json\/wp\/v2\/posts\/155"}],"collection":[{"href":"https:\/\/fireinsect.top\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fireinsect.top\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fireinsect.top\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fireinsect.top\/index.php\/wp-json\/wp\/v2\/comments?post=155"}],"version-history":[{"count":3,"href":"https:\/\/fireinsect.top\/index.php\/wp-json\/wp\/v2\/posts\/155\/revisions"}],"predecessor-version":[{"id":479,"href":"https:\/\/fireinsect.top\/index.php\/wp-json\/wp\/v2\/posts\/155\/revisions\/479"}],"wp:attachment":[{"href":"https:\/\/fireinsect.top\/index.php\/wp-json\/wp\/v2\/media?parent=155"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fireinsect.top\/index.php\/wp-json\/wp\/v2\/categories?post=155"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fireinsect.top\/index.php\/wp-json\/wp\/v2\/tags?post=155"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}