{"id":611,"date":"2026-11-15T12:42:59","date_gmt":"2026-11-15T04:42:59","guid":{"rendered":"https:\/\/www.zhukaifu.cn\/?p=611"},"modified":"2026-11-15T12:42:59","modified_gmt":"2026-11-15T04:42:59","slug":"krahets-hello-algo-%c2%b7-%e4%b8%ad%e6%96%87%e4%bb%8b%e7%bb%8d","status":"publish","type":"post","link":"https:\/\/www.zhukaifu.cn\/?p=611","title":{"rendered":"krahets\/hello-algo \u00b7 \u4e2d\u6587\u4ecb\u7ecd"},"content":{"rendered":"<!-- gh-sync:repo:krahets\/hello-algo -->\n\n<div id=\"gh-catalog\"><style>#gh-catalog{color-scheme:dark;--bg:#0b1120;--panel:#141f33;--line:#29364e;--text:#e6edf8;--muted:#9aaac3;--accent:#69d4ff}#gh-catalog *{box-sizing:border-box}#gh-catalog{margin:0;background:radial-gradient(ellipse at 15% 0,#172d4b 0,transparent 55%),var(--bg);color:var(--text);font:15px\/1.75 system-ui,\"Microsoft YaHei\",sans-serif;min-height:100vh}#gh-catalog main{max-width:1100px;margin:auto;padding:48px 24px 80px}#gh-catalog a{color:var(--accent);text-decoration:none}#gh-catalog a:hover{text-decoration:underline}#gh-catalog h1{font-size:clamp(27px,4vw,42px);letter-spacing:-.03em;line-height:1.3;margin:22px 0 12px;overflow-wrap:anywhere}#gh-catalog h2{font-size:20px;line-height:1.5;margin:0 0 12px;overflow-wrap:anywhere}#gh-catalog p{margin:12px 0}#gh-catalog .eyebrow{font-size:12px;letter-spacing:.18em;color:var(--accent);font-weight:700}#gh-catalog .meta{color:var(--muted);font-size:13px}#gh-catalog article{background:linear-gradient(135deg,#19273d,#131e30);border:1px solid var(--line);border-radius:18px;padding:26px;margin:16px 0;box-shadow:0 10px 32px #0002}#gh-catalog article:hover{border-color:#456585}#gh-catalog nav{display:flex;gap:16px;flex-wrap:wrap;align-items:center;margin-top:18px}#gh-catalog nav a{font-size:14px}#gh-catalog a:focus-visible,#gh-catalog button:focus-visible,#gh-catalog input:focus-visible{outline:3px solid var(--accent);outline-offset:4px}#gh-catalog .rank{display:inline-flex;align-items:center;justify-content:center;min-width:42px;height:32px;border-radius:9px;background:#263751;color:#bdcce2;font-size:14px;margin-right:12px;font-variant-numeric:tabular-nums}#gh-catalog .top-rank{background:#514224;color:#ffe09a}#gh-catalog .search-panel{position:sticky;top:0;z-index:3;padding:16px 0 12px;background:#0b1120f2;backdrop-filter:blur(12px)}#gh-catalog .search-row{display:flex;gap:10px;margin-top:8px}#gh-catalog input{width:100%;min-width:0;padding:14px 16px;border:1px solid #405371;border-radius:12px;background:#111e33;color:var(--text);font:inherit}#gh-catalog input::placeholder{color:#91a2bd}#gh-catalog button{border:1px solid #405371;border-radius:12px;background:#22344e;color:var(--text);padding:10px 18px;cursor:pointer;font:inherit;white-space:nowrap}#gh-catalog .empty{border:1px dashed #405371;border-radius:18px;text-align:center;padding:48px 20px;color:var(--muted)}#gh-catalog [hidden]{display:none!important}#gh-catalog li{margin:12px 0}#gh-catalog footer{margin-top:32px;border-top:1px solid var(--line);padding-top:18px;color:var(--muted);font-size:12px}@media(max-width:600px){#gh-catalog main{padding:24px 16px 48px}#gh-catalog article{padding:20px 16px}#gh-catalog h2{font-size:17px}#gh-catalog .rank{min-width:34px;margin-right:8px}#gh-catalog .search-panel{padding-top:10px}}#gh-catalog .search-panel{background:linear-gradient(120deg,#203148f5,#1c293cf5);border:1px solid #3c4d65;border-radius:18px;padding:20px 22px 12px;box-shadow:0 12px 32px #0003;margin:24px 0}#gh-catalog .search-panel label{font-weight:600;color:#d5e2f3}#gh-catalog .search-row{flex-wrap:wrap;align-items:center}#gh-catalog .search-row input{flex:1 1 280px;width:auto;background:#111c2c;border-color:#475a73}#gh-catalog .sort-label{font-size:13px}#gh-catalog .search-row select{padding:13px 12px;border-radius:11px;border:1px solid #526581;background:#293b52;color:#edf3fc;font:inherit;max-width:100%}#gh-catalog .search-row button{background:#344961;border-color:#536a85}#gh-catalog .search-row select:focus-visible{outline:3px solid var(--accent);outline-offset:3px}#gh-catalog article nav{gap:12px;margin-top:20px}#gh-catalog article nav a{display:inline-flex;align-items:center;justify-content:center;padding:10px 18px;border-radius:10px;font-weight:600;font-size:13px;border:1px solid #526a87;background:#263a52;color:#dce9fa;transition:background .18s,border-color .18s,transform .18s}#gh-catalog article nav a:first-child{background:linear-gradient(135deg,#77ddf5,#96baff);border-color:#8ed6f4;color:#11243a;box-shadow:0 4px 14px #5ea7e51a}#gh-catalog article nav a:hover{background:#38516d;border-color:#8da9cb;text-decoration:none;transform:translateY(-1px)}#gh-catalog article nav a:first-child:hover{background:#b3e9ff;color:#0b1d31}#gh-catalog .collected{display:inline-flex;gap:6px;margin:10px 0 0;padding:4px 10px;background:#223247;border:1px solid #354b63;border-radius:8px;font-size:12px;color:#b6c8df}#gh-catalog .sort-note{font-size:12px;color:#a4b6cc}@media(max-width:600px){#gh-catalog .search-panel{padding:16px}#gh-catalog .search-row input{flex-basis:100%}#gh-catalog article nav a{flex:1;padding:10px 12px}}\n<\/style><main><nav><a href=\"https:\/\/www.zhukaifu.cn\/?p=575\">\u2190 \u70ed\u95e8\u4ed3\u5e93\u5217\u8868<\/a><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https:\/\/github.com\/krahets\/hello-algo\">\u6253\u5f00 GitHub \u4ed3\u5e93<\/a><\/nav><h1>krahets\/hello-algo<\/h1><p class=\"meta\">\u2605 132,243 \u00b7 Forks 15,620<\/p><article><h2>\u300aHello \u7b97\u6cd5\u300b\u662f\u4e00\u672c\u5f00\u6e90\u514d\u8d39\u7684\u6570\u636e\u7ed3\u6784\u4e0e\u7b97\u6cd5\u5165\u95e8\u6559\u7a0b\uff0c\u7528\u52a8\u753b\u56fe\u89e3\u548c\u53ef\u8fd0\u884c\u4ee3\u7801\u5e2e\u52a9\u521d\u5b66\u8005\u7406\u89e3\u539f\u7406\u5e76\u52a8\u624b\u7ec3\u4e60\u3002<\/h2><p>\u300aHello \u7b97\u6cd5\u300b\uff1a\u52a8\u753b\u56fe\u89e3\u3001\u53ef\u4e00\u952e\u8fd0\u884c\u7684\u6570\u636e\u7ed3\u6784\u4e0e\u7b97\u6cd5\u6559\u7a0b\uff0c\u652f\u6301\u7b80\u7e41\u4e2d\u6587\u3001\u82f1\u6587\u548c\u65e5\u6587\uff0c\u63d0\u4f9b Python\u3001Java\u3001C++ \u7b49\u591a\u79cd\u8bed\u8a00\u5b9e\u73b0\u3002<\/p><ul><li>\u9002\u5408\u7b97\u6cd5\u521d\u5b66\u8005\uff0c\u8bb2\u89e3\u6570\u636e\u7684\u7ec4\u7ec7\u65b9\u5f0f\u3001\u7b97\u6cd5\u7684\u5de5\u4f5c\u539f\u7406\u53ca\u5176\u4ee3\u7801\u5b9e\u73b0\u3002<\/li><li>\u7528\u52a8\u753b\u56fe\u89e3\u5c55\u793a\u77e5\u8bc6\uff0c\u914d\u5408\u4e00\u952e\u8fd0\u884c\u7684\u793a\u4f8b\u4ee3\u7801\uff0c\u5e2e\u52a9\u8bfb\u8005\u8fb9\u770b\u8fb9\u7ec3\u3002<\/li><li>\u63d0\u4f9b Python\u3001Java\u3001C++ \u7b49\u591a\u79cd\u8bed\u8a00\u5b9e\u73b0\uff0c\u53ef\u9009\u62e9\u81ea\u5df1\u719f\u6089\u7684\u8bed\u8a00\u5b66\u4e60\u3002<\/li><li>\u5165\u95e8\u53ef\u6309\u201c\u5728\u7ebf\u9605\u8bfb\u6216\u4e0b\u8f7d PDF\u3001EPUB \u2192 \u770b\u56fe\u7406\u89e3 \u2192 \u8fd0\u884c\u793a\u4f8b \u2192 \u4fee\u6539\u4ee3\u7801\u7ec3\u4e60\u201d\u7684\u6d41\u7a0b\u8fdb\u884c\u3002<\/li><li>\u652f\u6301\u591a\u79cd\u9605\u8bfb\u8bed\u8a00\uff0c\u8bfb\u8005\u53ef\u4ee5\u5728\u8bc4\u8bba\u533a\u63d0\u95ee\u4ea4\u6d41\uff0c\u4e5f\u53ef\u4ee5\u53c2\u4e0e\u5185\u5bb9\u4fee\u6b63\u3001\u4ee3\u7801\u8f6c\u8bd1\u548c\u7ffb\u8bd1\u6821\u5bf9\u3002<\/li><\/ul><\/article><p class=\"meta\">\u4f9d\u636e\u5df2\u8bfb\u53d6\u7684 README \u8d44\u6599\u7f16\u5199\uff1b\u8f83\u957f\u8d44\u6599\u53ef\u80fd\u4f7f\u7528\u8282\u9009\uff0c\u672a\u5b9e\u9645\u6d4b\u8bd5\u4ed3\u5e93\u529f\u80fd\u3002<br>\u8d44\u6599\u6765\u6e90\uff1a<a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https:\/\/github.com\/krahets\/hello-algo\/blob\/main\/README.md\">README<\/a> \u00b7 \u5185\u5bb9\u751f\u6210\u65f6\u95f4\uff1a2026-11-13T07:35:23+00:00<\/p><\/main><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u2190 \u70ed\u95e8\u4ed3\u5e93\u5217\u8868\u6253\u5f00 GitHub \u4ed3\u5e93 krahets\/hello-algo &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-611","post","type-post","status-publish","format-standard","hentry","category-thinking"],"_links":{"self":[{"href":"https:\/\/www.zhukaifu.cn\/index.php?rest_route=\/wp\/v2\/posts\/611","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.zhukaifu.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zhukaifu.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zhukaifu.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zhukaifu.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=611"}],"version-history":[{"count":2,"href":"https:\/\/www.zhukaifu.cn\/index.php?rest_route=\/wp\/v2\/posts\/611\/revisions"}],"predecessor-version":[{"id":1117,"href":"https:\/\/www.zhukaifu.cn\/index.php?rest_route=\/wp\/v2\/posts\/611\/revisions\/1117"}],"wp:attachment":[{"href":"https:\/\/www.zhukaifu.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=611"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhukaifu.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=611"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhukaifu.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=611"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}