{"id":175755,"date":"2024-05-08T18:57:14","date_gmt":"2024-05-08T10:57:14","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/175755.html"},"modified":"2024-05-08T18:57:25","modified_gmt":"2024-05-08T10:57:25","slug":"python%e7%9a%84%e5%ba%95%e5%b1%82%e5%ae%9e%e7%8e%b0%e4%b8%ad%ef%bc%8clist%e7%9a%84sort%e5%87%bd%e6%95%b0%e6%98%af%e5%a6%82%e4%bd%95%e5%ae%9e%e7%8e%b0%e7%9a%84","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/175755.html","title":{"rendered":"python\u7684\u5e95\u5c42\u5b9e\u73b0\u4e2d\uff0clist\u7684sort\u51fd\u6570\u662f\u5982\u4f55\u5b9e\u73b0\u7684"},"content":{"rendered":"<p style=\"text-align:center\"><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/27053802\/f1b4f419-66d1-40df-b86a-800b8247e816.webp\" alt=\"python\u7684\u5e95\u5c42\u5b9e\u73b0\u4e2d\uff0clist\u7684sort\u51fd\u6570\u662f\u5982\u4f55\u5b9e\u73b0\u7684\" \/><\/p>\n<p><p>\u5728Python\u7684\u5e95\u5c42\u5b9e\u73b0\u4e2d\uff0c<strong>list\u7684sort\u51fd\u6570\u662f\u57fa\u4e8eTimSort\u7b97\u6cd5\u5b9e\u73b0\u7684<\/strong>\u3002TimSort\u662f\u4e00\u79cd\u6df7\u5408\u6392\u5e8f\u7b97\u6cd5\uff0c\u7ed3\u5408\u4e86\u5f52\u5e76\u6392\u5e8f\uff08Merge Sort\uff09\u548c\u63d2\u5165\u6392\u5e8f\uff08Insertion Sort\uff09\u7684\u4f18\u70b9\u3002\u8fd9\u79cd\u7b97\u6cd5\u80fd\u591f\u5728\u6700\u574f\u60c5\u51b5\u4e0b\u63d0\u4f9b\u7a33\u5b9a\u7684O(n log n)\u65f6\u95f4\u590d\u6742\u5ea6\uff0c\u5e76\u4e14\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\u8868\u73b0\u51fa\u975e\u5e38\u9ad8\u7684\u6548\u7387\uff0c\u7279\u522b\u662f\u5bf9\u90e8\u5206\u6709\u5e8f\u7684\u6570\u636e\u3002TimSort\u7b97\u6cd5\u9996\u5148\u4f1a\u5c06\u5217\u8868\u5206\u5272\u6210\u591a\u4e2a\u5c0f\u5757\uff08\u79f0\u4e3a<strong>\u8fd0\u884c<\/strong>\uff09\uff0c\u7136\u540e\u5bf9\u6bcf\u4e2a\u5c0f\u5757\u4f7f\u7528\u63d2\u5165\u6392\u5e8f\u4ee5\u786e\u4fdd\u5b83\u4eec\u662f\u6709\u5e8f\u7684\u3002\u6700\u540e\u518d\u4f7f\u7528\u7c7b\u4f3c\u5f52\u5e76\u6392\u5e8f\u7684\u65b9\u6cd5\u5c06\u8fd9\u4e9b\u6709\u5e8f\u5c0f\u5757\u5408\u5e76\u6210\u4e00\u4e2a\u6709\u5e8f\u7684\u5217\u8868\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001Timsort\u7b97\u6cd5\u6982\u8ff0<\/h3>\n<\/p>\n<p><p>TimSort\u7b97\u6cd5\u662fPython\u4e2dlist\u6392\u5e8f\u65b9\u6cd5\u7684\u6838\u5fc3\uff0c<strong>\u7531Tim Peters\u57282002\u5e74\u5f00\u53d1<\/strong>\uff0c\u73b0\u5728\u88ab\u5e7f\u6cdb\u7528\u4e8ePython\u548cJava\u7b49\u8bed\u8a00\u4e2d\u3002\u5b83\u662f\u4e00\u79cd\u7a33\u5b9a\u7684\u3001\u81ea\u9002\u5e94\u7684\u3001\u9ad8\u6548\u7684\u6392\u5e8f\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<p><h4>\u8fd0\u884c\u7684\u521b\u5efa\u4e0e\u63d2\u5165\u6392\u5e8f<\/h4>\n<\/p>\n<p><p>TimSort\u5f00\u59cb\u4e8e\u626b\u63cf\u6574\u4e2a\u5217\u8868\uff0c\u4ee5\u8bc6\u522b\u6216\u521b\u5efa\u77ed\u6709\u5e8f\u7684\u5217\u8868\u7247\u6bb5\uff0c\u5373\u201c\u8fd0\u884c\u201d\u3002\u5b83\u4f1a\u5c1d\u8bd5\u5229\u7528\u5217\u8868\u4e2d\u5df2\u7ecf\u5b58\u5728\u7684\u6709\u5e8f\u7247\u6bb5\uff0c\u6765\u51cf\u5c11\u4e0d\u5fc5\u8981\u7684\u5de5\u4f5c\u3002<\/p>\n<\/p>\n<p><p>\u5982\u679c\u5728\u626b\u63cf\u8fc7\u7a0b\u4e2d\uff0c\u76f8\u90bb\u5143\u7d20\u672c\u6765\u5c31\u662f\u6709\u5e8f\u7684\uff0c\u5219\u76f4\u63a5\u5c06\u5b83\u4eec\u4f5c\u4e3a\u4e00\u4e2a\u8fd0\u884c\u3002\u76f8\u53cd\uff0c\u5982\u679c\u53d1\u73b0\u662f\u9006\u5e8f\u7684\uff0c\u5219\u7b97\u6cd5\u4f1a\u5c06\u8fd9\u4e9b\u5143\u7d20\u53cd\u8f6c\u6210\u6709\u5e8f\u72b6\u6001\uff0c\u540c\u65f6\u5f53\u8fd0\u884c\u957f\u5ea6\u4f4e\u4e8e\u67d0\u4e2a\u9884\u8bbe\u7684\u9608\u503c\u65f6\uff0cTimSort\u4f1a\u4f7f\u7528\u63d2\u5165\u6392\u5e8f\u7b97\u6cd5\u5bf9\u8fd9\u4e2a\u77ed\u7247\u6bb5\u8fdb\u884c\u6392\u5e8f\u3002<\/p>\n<\/p>\n<p><h4>\u6700\u5c0f\u8fd0\u884c\u5927\u5c0f\u9009\u62e9<\/h4>\n<\/p>\n<p><p>\u4e3a\u4e86\u4f18\u5316\u6392\u5e8f\u8fc7\u7a0b\uff0cTimSort\u4f1a\u9009\u62e9\u4e00\u4e2a\u6700\u5c0f\u8fd0\u884c\u5927\u5c0f\u3002\u8fd9\u4e2a\u5927\u5c0f\u4f1a\u6839\u636e\u5f85\u6392\u5e8f\u5217\u8868\u7684\u957f\u5ea6\u6765\u786e\u5b9a\uff0c\u4ee5\u786e\u4fdd\u5408\u5e76\u8fc7\u7a0b\u4e2d\u7684\u6548\u7387\u3002TimSort\u901a\u8fc7\u8ba1\u7b97\u6765\u9009\u62e9\u8fd9\u4e2a\u503c\uff0c\u4ee5\u786e\u4fdd\u5408\u5e76\u64cd\u4f5c\u4e0d\u4f1a\u6210\u4e3a\u6548\u7387\u74f6\u9888\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u3001\u5408\u5e76\u8fc7\u7a0b<\/h3>\n<\/p>\n<p><p>\u4e00\u65e6\u6240\u6709\u7684\u8fd0\u884c\u88ab\u521b\u5efa\u548c\u6392\u5e8f\u540e\uff0c\u63a5\u4e0b\u6765\u7684\u4efb\u52a1\u662f\u5c06\u8fd9\u4e9b\u8fd0\u884c\u5408\u5e76\uff08merge\uff09\u6210\u66f4\u5927\u7684\u5df2\u6392\u5e8f\u7684\u5e8f\u5217\u3002\u8fd9\u4e00\u9636\u6bb5\u975e\u5e38\u7c7b\u4f3c\u4e8e\u5f52\u5e76\u6392\u5e8f\u4e2d\u7684\u5408\u5e76\u64cd\u4f5c\u3002<\/p>\n<\/p>\n<p><h4>\u5f52\u5e76\u6392\u5e8f\u539f\u7406<\/h4>\n<\/p>\n<p><p>\u5f52\u5e76\u6392\u5e8f\u662f\u4e00\u79cd\u5178\u578b\u7684\u5206\u800c\u6cbb\u4e4b\u7b97\u6cd5\uff0c\u5b83\u4e0d\u65ad\u5730\u5c06\u5217\u8868\u5206\u5272\u6210\u66f4\u5c0f\u7684\u90e8\u5206\uff0c\u7136\u540e\u5c06\u90a3\u4e9b\u6709\u5e8f\u7684\u5c0f\u90e8\u5206\u5408\u5e76\u6210\u5927\u7684\u6709\u5e8f\u5217\u8868\u3002\u5728TimSort\u4e2d\uff0c\u8fd9\u4e2a\u539f\u7406\u88ab\u7528\u5728\u4e86\u5408\u5e76\u8fd0\u884c\u7684\u8fc7\u7a0b\u4e2d\u3002<\/p>\n<\/p>\n<p><h4>\u53cc\u7f13\u51b2\u6280\u672f<\/h4>\n<\/p>\n<p><p>\u5728\u5408\u5e76\u8fc7\u7a0b\u4e2d\uff0cTimSort\u4f7f\u7528\u4e00\u79cd\u540d\u4e3a\u201c\u53cc\u7f13\u51b2\u201d\u6280\u672f\uff0c\u53ef\u4ee5\u51cf\u5c11\u6570\u636e\u590d\u5236\u64cd\u4f5c\u7684\u6b21\u6570\uff0c\u8fd9\u662f\u901a\u8fc7\u5728\u5408\u5e76\u4e4b\u524d\u5c06\u4e00\u4e2a\u8fd0\u884c\u7684\u5143\u7d20\u590d\u5236\u5230\u4e00\u4e2a\u4e34\u65f6\u7a7a\u95f4\u5b9e\u73b0\u7684\u3002\u8fd9\u5927\u5927\u63d0\u9ad8\u4e86\u5408\u5e76\u64cd\u4f5c\u7684\u6548\u7387\u3002<\/p>\n<\/p>\n<p><h3>\u4e09\u3001\u4f18\u5316\u548c\u81ea\u9002\u5e94<\/h3>\n<\/p>\n<p><p>TimSort\u7b97\u6cd5\u975e\u5e38\u6ce8\u91cd\u6548\u7387\u548c\u9002\u5e94\u4e0d\u540c\u7c7b\u578b\u6570\u636e\u96c6\u7684\u80fd\u529b\u3002<\/p>\n<\/p>\n<p><h4>\u4e8c\u5206\u67e5\u627e\u7684\u5229\u7528<\/h4>\n<\/p>\n<p><p>\u5728\u67d0\u4e9b\u6b65\u9aa4\uff0c\u4f8b\u5982\u63d2\u5165\u6392\u5e8f\u9636\u6bb5\uff0c\u4e3a\u4e86\u63d0\u9ad8\u6548\u7387\uff0cTimSort\u4f1a\u5229\u7528\u4e8c\u5206\u67e5\u627e\u6765\u786e\u5b9a\u5143\u7d20\u5e94\u8be5\u63d2\u5165\u7684\u4f4d\u7f6e\u3002\u8fd9\u51cf\u5c11\u4e86\u5fc5\u987b\u6bd4\u8f83\u7684\u5143\u7d20\u7684\u6570\u91cf\u3002<\/p>\n<\/p>\n<p><h4>\u7194\u65ad\u673a\u5236<\/h4>\n<\/p>\n<p><p>TimSort\u5728\u5408\u5e76\u8fc7\u7a0b\u4e2d\u5177\u6709\u4e00\u79cd\u7279\u6b8a\u7684\u7194\u65ad\u673a\u5236\u3002\u5f53\u5b83\u53d1\u73b0\u5269\u4f59\u7684\u5143\u7d20\u5df2\u7ecf\u6709\u5e8f\u65f6\uff0c\u5b83\u4f1a\u4e2d\u65ad\u5408\u5e76\u8fc7\u7a0b\u5e76\u76f4\u63a5\u5c06\u8fd9\u4e9b\u5143\u7d20\u8ffd\u52a0\u5230\u5408\u5e76\u7684\u7ed3\u679c\u4e2d\uff0c\u8fd9\u6837\u505a\u51cf\u5c11\u4e86\u4e0d\u5fc5\u8981\u7684\u5408\u5e76\u548c\u6570\u636e\u79fb\u52a8\u3002<\/p>\n<\/p>\n<p><h3>\u56db\u3001\u7a33\u5b9a\u6027\u548c\u5b9e\u7528\u6027<\/h3>\n<\/p>\n<p><p>TimSort\u662f\u4e00\u79cd\u7a33\u5b9a\u6027\u7684\u6392\u5e8f\u7b97\u6cd5\uff0c\u610f\u5473\u7740<strong>\u76f8\u7b49\u5143\u7d20\u7684\u524d\u540e\u987a\u5e8f\u5728\u6392\u5e8f\u524d\u540e\u4e0d\u4f1a\u6539\u53d8<\/strong>\uff0c\u8fd9\u5bf9\u4e8e\u67d0\u4e9b\u4f9d\u8d56\u4e8e\u7a33\u5b9a\u6392\u5e8f\u7684\u5e94\u7528\u975e\u5e38\u91cd\u8981\u3002<\/p>\n<\/p>\n<p><h4>\u7a33\u5b9a\u6027\u7684\u91cd\u8981\u6027<\/h4>\n<\/p>\n<p><p>\u7a33\u5b9a\u6027\u5728\u591a\u5173\u952e\u5b57\u6392\u5e8f\u6216\u6392\u5e8f\u540e\u9700\u4fdd\u6301\u5143\u7d20\u76f8\u5bf9\u4f4d\u7f6e\u7684\u60c5\u51b5\u4e0b\u5c24\u4e3a\u91cd\u8981\u3002\u7531\u4e8eTimSort\u53ef\u4ee5\u4fdd\u8bc1\u7a33\u5b9a\u6027\uff0c\u5b83\u5728\u5904\u7406\u542b\u6709\u590d\u6742\u6570\u636e\u7ed3\u6784\u7684\u5217\u8868\u65f6\u5c24\u5176\u5b9d\u8d35\u3002<\/p>\n<\/p>\n<p><h4>\u9762\u5bf9\u5b9e\u9645\u6570\u636e\u7684\u4f18\u52bf<\/h4>\n<\/p>\n<p><p>TimSort\u88ab\u8bbe\u8ba1\u4e3a\u5728\u9762\u5bf9\u73b0\u5b9e\u4e16\u754c\u4e2d\u7684\u5404\u79cd\u6570\u636e\u5206\u5e03\u65f6\u90fd\u80fd\u8868\u73b0\u51fa\u826f\u597d\u7684\u6027\u80fd\u3002\u5b83\u77e5\u9053\u5982\u4f55\u5229\u7528\u6570\u636e\u7684\u6709\u5e8f\u6027\u4ee5\u53ca\u5982\u4f55\u5904\u7406\u5927\u89c4\u6a21\u7684\u6570\u636e\u96c6\u3002\u65e0\u8bba\u662f\u5b8c\u5168\u968f\u673a\u7684\u3001\u90e8\u5206\u6709\u5e8f\u7684\u8fd8\u662f\u8fd1\u4e4e\u6709\u5e8f\u7684\u6570\u636e\uff0cTimSort\u90fd\u80fd\u6709\u6548\u5730\u5de5\u4f5c\uff0c\u76f8\u6bd4\u4f20\u7edf\u7684\u6392\u5e8f\u7b97\u6cd5\u6709\u7740\u660e\u663e\u7684\u4f18\u52bf\u3002<\/p>\n<\/p>\n<p><h3>\u7ed3\u8bba<\/h3>\n<\/p>\n<p><p>\u603b\u4e4b\uff0c<strong>Python\u4e2d\u5217\u8868\u7684sort\u51fd\u6570\u5229\u7528\u7684\u662fTimSort\uff1a\u4e00\u79cd\u9ad8\u6548\u3001\u81ea\u9002\u5e94\u3001\u7a33\u5b9a\u4e14\u6df7\u5408\u4e86\u5f52\u5e76\u6392\u5e8f\u548c\u63d2\u5165\u6392\u5e8f\u4f18\u70b9\u7684\u7b97\u6cd5<\/strong>\u3002\u5b83\u901a\u8fc7\u667a\u80fd\u5730\u5206\u6790\u6570\u636e\u6765\u4f18\u5316\u6392\u5e8f\u8fc7\u7a0b\uff0c\u4f7f\u5f97\u5728\u5e73\u5747\u60c5\u51b5\u4e0b\u6709\u5f88\u597d\u7684\u65f6\u95f4\u590d\u6742\u5ea6\uff0c\u540c\u65f6\u5728\u6700\u574f\u60c5\u51b5\u4e0b\u4e5f\u4fdd\u6301\u4e86\u53ef\u9884\u6d4b\u7684\u6027\u80fd\u3002\u5bf9\u4e8e\u8f6f\u4ef6\u5f00\u53d1\u8005\u6765\u8bf4\uff0c\u7406\u89e3TimSort\u7684\u5de5\u4f5c\u539f\u7406\u53ef\u4ee5\u5e2e\u52a9\u4ed6\u4eec\u5728\u5904\u7406\u6392\u5e8f\u95ee\u9898\u65f6\u505a\u51fa\u66f4\u660e\u667a\u7684\u51b3\u7b56\uff0c\u5c24\u5176\u662f\u5f53\u5904\u7406\u5927\u91cf\u548c\u590d\u6742\u6570\u636e\u65f6\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p><strong>\u95ee\u98981\uff1aPython\u4e2dlist\u7684sort\u51fd\u6570\u662f\u5982\u4f55\u5b9e\u73b0\u7684\uff1f<\/strong><\/p>\n<p>\u56de\u7b54\uff1aPython\u4e2d\u7684list\u7c7b\u578b\u6709\u4e00\u4e2a\u5185\u7f6e\u7684sort()\u51fd\u6570\uff0c\u7528\u4e8e\u5bf9\u5217\u8868\u8fdb\u884c\u6392\u5e8f\u3002sort()\u51fd\u6570\u7684\u5e95\u5c42\u5b9e\u73b0\u4f7f\u7528\u4e86\u4e00\u79cd\u9ad8\u6548\u7684\u6392\u5e8f\u7b97\u6cd5\uff0c\u79f0\u4e3aTimsort\u3002Timsort\u7b97\u6cd5\u662f\u4e00\u79cd\u6df7\u5408\u4e86\u5f52\u5e76\u6392\u5e8f\u548c\u63d2\u5165\u6392\u5e8f\u7684\u7a33\u5b9a\u6392\u5e8f\u7b97\u6cd5\uff0c\u5b83\u662f\u7531Tim Peters\u5728Python\u4e2d\u5b9e\u73b0\u7684\u3002Timsort\u7b97\u6cd5\u7684\u4f18\u70b9\u662f\u5728\u5927\u591a\u6570\u60c5\u51b5\u4e0b\u90fd\u80fd\u4ee5\u6700\u4f18\u7684\u65f6\u95f4\u590d\u6742\u5ea6O(n log n)\u8fdb\u884c\u6392\u5e8f\uff0c\u5e76\u4e14\u5bf9\u4e8e\u5df2\u7ecf\u6709\u90e8\u5206\u6709\u5e8f\u7684\u5217\u8868\uff0c\u5b83\u80fd\u591f\u5229\u7528\u5230\u8fd9\u4e9b\u6709\u5e8f\u7684\u90e8\u5206\uff0c\u63d0\u9ad8\u6392\u5e8f\u7684\u6548\u7387\u3002<\/p>\n<p><strong>\u95ee\u98982\uff1aPython\u4e2d\u7684list\u6392\u5e8f\u51fd\u6570\u662f\u5982\u4f55\u5b9e\u73b0\u7684\uff1f<\/strong><\/p>\n<p>\u56de\u7b54\uff1aPython\u4e2d\u7684list\u7c7b\u578b\u63d0\u4f9b\u4e86sort()\u51fd\u6570\uff0c\u7528\u4e8e\u5bf9\u5217\u8868\u8fdb\u884c\u6392\u5e8f\u3002\u8fd9\u4e2a\u6392\u5e8f\u51fd\u6570\u7684\u5b9e\u73b0\u57fa\u4e8eTimsort\u7b97\u6cd5\u3002Timsort\u662f\u4e00\u79cd\u9ad8\u6548\u7684\u6392\u5e8f\u7b97\u6cd5\uff0c\u5b83\u7ed3\u5408\u4e86\u5f52\u5e76\u6392\u5e8f\u548c\u63d2\u5165\u6392\u5e8f\u7684\u4f18\u70b9\u3002Timsort\u7684\u6838\u5fc3\u601d\u60f3\u662f\u5148\u5c06\u5217\u8868\u5212\u5206\u4e3a\u591a\u4e2a\u5c0f\u7684\u5757\uff0c\u7136\u540e\u5bf9\u8fd9\u4e9b\u5c0f\u5757\u4f7f\u7528\u63d2\u5165\u6392\u5e8f\u8fdb\u884c\u6392\u5e8f\uff0c\u6700\u540e\u518d\u4f7f\u7528\u5f52\u5e76\u6392\u5e8f\u5c06\u8fd9\u4e9b\u6709\u5e8f\u7684\u5c0f\u5757\u5408\u5e76\u6210\u4e00\u4e2a\u6709\u5e8f\u7684\u5217\u8868\u3002\u8fd9\u79cd\u7b97\u6cd5\u5728\u5927\u591a\u6570\u60c5\u51b5\u4e0b\u90fd\u5177\u6709\u5f88\u9ad8\u7684\u6027\u80fd\uff0c\u5e76\u4e14\u5bf9\u4e8e\u5df2\u7ecf\u6709\u90e8\u5206\u6709\u5e8f\u7684\u5217\u8868\uff0c\u5b83\u80fd\u591f\u66f4\u5feb\u5730\u5b8c\u6210\u6392\u5e8f\u3002<\/p>\n<p><strong>\u95ee\u98983\uff1alist\u7684\u6392\u5e8f\u51fd\u6570\u5728Python\u5e95\u5c42\u662f\u5982\u4f55\u5b9e\u73b0\u7684\uff1f<\/strong><\/p>\n<p>\u56de\u7b54\uff1aPython\u4e2d\u7684list\u7c7b\u578b\u63d0\u4f9b\u4e86sort()\u51fd\u6570\uff0c\u7528\u4e8e\u5bf9\u5217\u8868\u8fdb\u884c\u6392\u5e8f\u3002sort()\u51fd\u6570\u7684\u5e95\u5c42\u5b9e\u73b0\u91c7\u7528\u4e86Timsort\u7b97\u6cd5\u3002Timsort\u7b97\u6cd5\u662f\u4e00\u79cd\u590d\u6742\u7684\u6392\u5e8f\u7b97\u6cd5\uff0c\u5b83\u7ed3\u5408\u4e86\u5f52\u5e76\u6392\u5e8f\u548c\u63d2\u5165\u6392\u5e8f\u7684\u4f18\u70b9\u3002Timsort\u7b97\u6cd5\u9996\u5148\u5c06\u5217\u8868\u5212\u5206\u6210\u591a\u4e2a\u5c0f\u5757\uff0c\u7136\u540e\u5bf9\u8fd9\u4e9b\u5c0f\u5757\u4ee5\u53ca\u5b83\u4eec\u4e4b\u95f4\u7684\u95f4\u9694\u5e94\u7528\u63d2\u5165\u6392\u5e8f\uff0c\u4ee5\u786e\u4fdd\u6bcf\u4e2a\u5c0f\u5757\u90fd\u662f\u6709\u5e8f\u7684\u3002\u63a5\u4e0b\u6765\uff0cTimsort\u7b97\u6cd5\u4f7f\u7528\u5f52\u5e76\u6392\u5e8f\u5c06\u8fd9\u4e9b\u6709\u5e8f\u7684\u5c0f\u5757\u5408\u5e76\u6210\u4e00\u4e2a\u6709\u5e8f\u7684\u5217\u8868\u3002\u8fd9\u79cd\u7b97\u6cd5\u5177\u6709\u8f83\u597d\u7684\u65f6\u95f4\u548c\u7a7a\u95f4\u6548\u7387\uff0c\u9002\u7528\u4e8e\u5927\u591a\u6570\u60c5\u51b5\u4e0b\u7684\u6392\u5e8f\u64cd\u4f5c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728Python\u7684\u5e95\u5c42\u5b9e\u73b0\u4e2d\uff0clist\u7684sort\u51fd\u6570\u662f\u57fa\u4e8eTimSort\u7b97\u6cd5\u5b9e\u73b0\u7684\u3002TimSort\u662f\u4e00\u79cd\u6df7\u5408\u6392\u5e8f [&hellip;]","protected":false},"author":3,"featured_media":175777,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/175755"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=175755"}],"version-history":[{"count":0,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/175755\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/175777"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=175755"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=175755"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=175755"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}