{"id":433,"date":"2016-04-16T11:44:26","date_gmt":"2016-04-16T03:44:26","guid":{"rendered":"http:\/\/www.xttblog.com\/?p=433"},"modified":"2016-04-16T18:18:25","modified_gmt":"2016-04-16T10:18:25","slug":"%e6%8e%92%e5%ba%8f%e7%ae%97%e6%b3%95%e5%8e%9f%e7%90%86%e4%b9%8b%e5%bf%ab%e9%80%9f%e6%8e%92%e5%ba%8f","status":"publish","type":"post","link":"https:\/\/www.xttblog.com\/?p=433","title":{"rendered":"\u6392\u5e8f\u7b97\u6cd5\u4e4b\u5feb\u901f\u6392\u5e8f\u539f\u7406\u4e0e\u5b9e\u6218"},"content":{"rendered":"<p>\n\t\u8bf4\u9053\u6392\u5e8f\uff0c\u6211\u76f8\u4fe1\u5927\u5bb6\u5e76\u4e0d\u6a21\u5f0f\u3002\u5728\u5199\u7a0b\u5e8f\u7684\u751f\u6daf\u4e2d\u6211\u4eec\u968f\u5904\u53ef\u89c1\u5230\u6392\u5e8f\u7684\u4f7f\u7528\u573a\u666f\uff0c\u4f8b\u5982\u6570\u636e\u5e93sql\u6392\u5e8f\u3002\u6392\u5e8f\u7684\u7b97\u6cd5\u6709\u5f88\u591a\u79cd\uff0c\u540c\u65f6java\u7b49\u8bed\u8a00\u4e5f\u90fd\u63d0\u4f9b\u4e86\u6392\u5e8f\u7684\u63a5\u53e3\uff0c\u65b9\u4fbf\u5927\u5bb6\u8fdb\u884c\u7b80\u5355\u6392\u5e8f\u529f\u80fd\u3002\u5173\u4e8e\u6392\u5e8f\u7b97\u6cd5\u6709\u5f88\u591a\u79cd\uff0c\u5982\u5feb\u901f\u6392\u5e8f\u3001\u76f4\u63a5\u63d2\u5165\u6392\u5e8f\u3001\u5e0c\u5c14\u6392\u5e8f\u3001\u7b80\u5355\u9009\u62e9\u6392\u5e8f\u3001\u4e8c\u5143\u9009\u62e9\u6392\u5e8f\u3001\u5192\u6ce1\u6392\u5e8f\u7b49\u3002\u8fd9\u4e9b\u6392\u5e8f\u6211\u5c06\u5199\u4e00\u7cfb\u5217\u7684\u6587\u7ae0\u8fdb\u884c\u539f\u7406\u89e3\u6790\u548c\u5b9e\u4f8b\u6f14\u793a\u3002\n<\/p>\n<p>\n\t<strong>\u5feb\u901f\u6392\u5e8f\u7684\u539f\u7406\u662f\uff1a<\/strong>\u4f7f\u4e00\u4e32\u8bb0\u5f55\uff0c\u6309\u7167\u5176\u4e2d\u7684\u67d0\u4e2a\u6216\u67d0\u4e9b\u5173\u952e\u5b57\u7684\u5927\u5c0f\uff0c\u9012\u589e\u6216\u9012\u51cf\u7684\u6392\u5217\u8d77\u6765\u7684\u64cd\u4f5c\u3002<br \/>\n\t<strong>\u57fa\u672c\u601d\u60f3\uff1a<\/strong>\u9009\u62e9\u4e00\u4e2a\u57fa\u51c6\u5143\u7d20,\u901a\u5e38\u9009\u62e9\u7b2c\u4e00\u4e2a\u5143\u7d20\u6216\u8005\u6700\u540e\u4e00\u4e2a\u5143\u7d20,\u901a\u8fc7\u4e00\u8d9f\u626b\u63cf\uff0c\u5c06\u5f85\u6392\u5e8f\u5217\u5206\u6210\u4e24\u90e8\u5206,\u4e00\u90e8\u5206\u6bd4\u57fa\u51c6\u5143\u7d20\u5c0f,\u4e00\u90e8\u5206\u5927\u4e8e\u7b49\u4e8e\u57fa\u51c6\u5143\u7d20,\u6b64\u65f6\u57fa\u51c6\u5143\u7d20\u5728\u5176\u6392\u597d\u5e8f\u540e\u7684\u6b63\u786e\u4f4d\u7f6e,\u7136\u540e\u518d\u7528\u540c\u6837\u7684\u65b9\u6cd5\u9012\u5f52\u5730\u6392\u5e8f\u5212\u5206\u7684\u4e24\u90e8\u5206\u3002<br \/>\n\t\u5feb\u901f\u6392\u5e8f\u5206\u89e3\u56fe\u5982\u4e0b\uff1a<br \/>\n\t<img decoding=\"async\" src=\"http:\/\/www.xttblog.com\/wp-content\/uploads\/2016\/04\/kuaisort.png\" \/><br \/>\n\t\u5feb\u901f\u6392\u5e8f\u5177\u4f53\u5b9e\u4f8b\u6e90\u7801\u5982\u4e0b\uff1a\n<\/p>\n<pre class=\"brush:java;\">\r\npackage com.xttblog.sort;\r\n\r\npublic class QuickSort {\r\n\t\/\/\u5feb\u901f\u6392\u5e8f\r\n\tprivate static void quickSort(int s[], int l, int r){\r\n\t\tif(l&gt;=r)\r\n\t\t\treturn;\r\n\t    \/\/\u5c06\u4e2d\u95f4\u7684\u8fd9\u4e2a\u6570\u548c\u7b2c\u4e00\u4e2a\u6570\u4ea4\u6362 \u53c2\u89c1\u6ce81\r\n\t\tint i = l, j = r, x = s[l];\r\n\t\twhile (i &lt; j){\r\n\t\t\twhile(i &lt; j &amp;&amp; s[j] &gt;= x) \/\/ \u4ece\u53f3\u5411\u5de6\u627e\u7b2c\u4e00\u4e2a\u5c0f\u4e8ex\u7684\u6570\r\n\t\t\t\tj--;  \r\n\t\t\tif(i &lt; j) \r\n\t\t\t\ts[i++] = s[j];\r\n\t\t\t\r\n\t\t\twhile(i &lt; j &amp;&amp; s[i] &lt; x) \/\/ \u4ece\u5de6\u5411\u53f3\u627e\u7b2c\u4e00\u4e2a\u5927\u4e8e\u7b49\u4e8ex\u7684\u6570\r\n\t\t\t\ti++;  \r\n\t\t\tif(i &lt; j) \r\n\t\t\t\ts[j--] = s[i];\r\n\t\t}\r\n\t\ts[i] = x;\r\n\t\tquickSort(s, l, i - 1); \/\/ \u9012\u5f52\u8c03\u7528 \r\n\t\tquickSort(s, i + 1, r);\r\n\t}\r\n\t\r\n\tpublic static void main(String[] args) {\r\n\t\tint s [] = {67,23,89,35,28,90,10,24};\r\n\t\tfor (int i : s) {\r\n\t\t\tSystem.out.print(i+&quot; &quot;);\r\n\t\t}\r\n\t\tquickSort(s,0,7);\r\n\t\tSystem.out.println();\r\n\t\tfor (int i : s) {\r\n\t\t\tSystem.out.print(i+&quot; &quot;);\r\n\t\t}\r\n\t\t\/\/\u6392\u5e8f\u524d\u540e\u8f93\u5165\u7ed3\u679c\u4e3a\uff1a\r\n\t\t\/\/67 23 89 35 28 90 10 24 \r\n\t\t\/\/10 23 24 28 35 67 89 90 \r\n\t}\r\n}<\/pre>\n<p>\n\t<strong>\u7248\u6743\u58f0\u660e\uff1a\u672c\u6587\u4e3a\u535a\u4e3b\u539f\u521b\u6587\u7ae0\uff0c\u672a\u7ecf\u535a\u4e3b\u5141\u8bb8\u4e0d\u5f97\u8f6c\u8f7d\u3002<\/strong>\u539f\u6587\u5730\u5740<a href=\"http:\/\/www.xttblog.com\/?p=433\" target=\"_blank\">http:\/\/www.xttblog.com\/?p=433<\/a><\/p>\n<!-- <audio autoplay=\"autoplay\" height=\"100\" width=\"100\" hidden=\"true\"><source src=\"https:\/\/c.coka.la\/orAvPR.mp3\" type=\"audio\/mp3\"\/><\/audio><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/ws3.sinaimg.cn\/large\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/> --><p><!-- <img decoding=\"async\" src=\"https:\/\/raw.githubusercontent.com\/xmt1139057136\/xttblog\/master\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/>--><img decoding=\"async\" src=\"https:\/\/saas.51autoparts.cn\/api\/admin\/sys-file\/oss\/file?fileName=84db51f8561e448f9a4fda2eff0811f9.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/><\/p><p>\u6700\u540e\uff0c\u6b22\u8fce\u5173\u6ce8\u6211\u7684\u4e2a\u4eba\u5fae\u4fe1\u516c\u4f17\u53f7\uff1a\u4e1a\u4f59\u8349\uff08yyucao\uff09\uff01<b>\u53ef\u52a0\u4f5c\u8005\u5fae\u4fe1\u53f7\uff1a<font color=\"red\">xttblog2<\/font>\u3002\u5907\u6ce8\uff1a\u201c1\u201d\uff0c\u6dfb\u52a0\u535a\u4e3b\u5fae\u4fe1\u62c9\u4f60\u8fdb\u5fae\u4fe1\u7fa4\u3002\u5907\u6ce8\u9519\u8bef\u4e0d\u4f1a\u540c\u610f\u597d\u53cb\u7533\u8bf7\u3002<\/b>\u518d\u6b21\u611f\u8c22\u60a8\u7684\u5173\u6ce8\uff01\u540e\u7eed\u6709\u7cbe\u5f69\u5185\u5bb9\u4f1a\u7b2c\u4e00\u65f6\u95f4\u53d1\u7ed9\u60a8\uff01\u539f\u521b\u6587\u7ae0\u6295\u7a3f\u8bf7\u53d1\u9001\u81f3532009913@qq.com\u90ae\u7bb1\u3002\u5546\u52a1\u5408\u4f5c\u4e5f\u53ef\u6dfb\u52a0\u4f5c\u8005\u5fae\u4fe1\u8fdb\u884c\u8054\u7cfb\uff01<\/p><p>\u672c\u6587\u539f\u6587\u51fa\u5904\uff1a<a href=\"https:\/\/www.xttblog.com\">\u4e1a\u4f59\u8349<\/a>\uff1a &raquo; <a href=\"https:\/\/www.xttblog.com\/?p=433\">\u6392\u5e8f\u7b97\u6cd5\u4e4b\u5feb\u901f\u6392\u5e8f\u539f\u7406\u4e0e\u5b9e\u6218<\/a><\/p><!-- <div class=\"bd-reward-stl\"><button id=\"bdRewardBtn\"><span><\/span><\/button><\/div> -->","protected":false},"excerpt":{"rendered":"<p>\u8bf4\u9053\u6392\u5e8f\uff0c\u6211\u76f8\u4fe1\u5927\u5bb6\u5e76\u4e0d\u6a21\u5f0f\u3002\u5728\u5199\u7a0b\u5e8f\u7684\u751f\u6daf\u4e2d\u6211\u4eec\u968f\u5904\u53ef\u89c1\u5230\u6392\u5e8f\u7684\u4f7f\u7528\u573a\u666f\uff0c\u4f8b\u5982\u6570\u636e\u5e93sql\u6392\u5e8f\u3002\u6392\u5e8f\u7684\u7b97\u6cd5\u6709 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[173,171,172],"class_list":["post-433","post","type-post","status-publish","format-standard","hentry","category-java","tag-173","tag-171","tag-172"],"_links":{"self":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/433","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=433"}],"version-history":[{"count":2,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/433\/revisions"}],"predecessor-version":[{"id":436,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/433\/revisions\/436"}],"wp:attachment":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=433"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=433"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=433"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}