[{"data":1,"prerenderedAt":1252},["ShallowReactive",2],{"blog-taxonomies":3,"blog-stats":507,"post-2025\u002F2025-12-26-javascripttypescript-的顺序表链表实现":1083},[4,11,16,21,25,29,36,39,44,47,52,58,63,66,71,76,80,84,87,93,96,101,105,110,113,117,122,127,132,136,141,143,146,151,155,157,162,165,169,173,176,179,183,186,190,193,197,200,205,208,211,214,219,222,228,234,237,239,245,249,253,256,260,266,271,276,281,283,287,290,293,298,301,304,306,308,311,314,316,318,321,327,332,337,342,347,352,354,356,358,361,365,367,369,371,374,376,378,381,386,390,393,396,400,404,407,411,413,415,417,421,423,425,428,431,433,435,437,439,441,443,446,448,450,454,456,459,461,463,465,467,469,471,473,477,483,486,488,491,493,495,497,499,501,503,505],{"category":5,"tags":6},"笔记",[7,8,9,10],"QQ","插件","LiteLoader","美化",{"category":12,"tags":13},"其他",[14,15,10],"博客","IP签名",{"category":17,"tags":18},"杂谈",[19,20],"互联网","观点",{"category":5,"tags":22},[14,23,24],"GitHub","数据可视化",{"category":5,"tags":26},[14,27,28],"访问统计","不蒜子",{"category":30,"tags":31},"工具",[32,33,34,35],"Python","爬虫","选课脚本","广州大学",{"category":5,"tags":37},[38,5],"数学分析",{"category":40,"tags":41},"算法",[42,40,43],"数据结构","线性表",{"category":40,"tags":45},[42,46],"复习",{"category":5,"tags":48},[49,50,51],"高等代数","线性代数","知识点",{"category":5,"tags":53},[14,54,55,56,57],"Typora","PicGo","图床","Markdown",{"category":30,"tags":59},[60,61,62],"Jupyter","工具配置","中文",{"category":30,"tags":64},[65,61,10],"VSCode",{"category":30,"tags":67},[68,69,70,35],"路由器","OpenWrt","校园网",{"category":12,"tags":72},[73,74,75],"网络协议","Wireshark","DEVP2P",{"category":5,"tags":77},[73,74,78,79],"Lua","解码器",{"category":5,"tags":81},[82,5,83],"常微分方程","数学",{"category":5,"tags":85},[86,5,83],"概率论",{"category":30,"tags":88},[89,90,91,92],"Docker","WSL","Windows","磁盘清理",{"category":30,"tags":94},[32,33,95,35],"课程表",{"category":5,"tags":97},[14,98,99,100],"Hexo","Gitalk","评论系统",{"category":5,"tags":102},[14,103,98,104],"Obsidian","写作工具",{"category":12,"tags":106},[107,108,109],"课题研究","泊松分布","参数估计",{"category":12,"tags":111},[107,108,109,112],"组会",{"category":12,"tags":114},[109,115,108,116],"IM模型","统计学",{"category":17,"tags":118},[119,120,121],"软考","网络规划","信息系统项目管理",{"category":30,"tags":123},[124,125,126],"Arch Linux","AppImage","Linux",{"category":5,"tags":128},[129,130,131],"编程语言","计算机科学","内存管理",{"category":5,"tags":133},[134,135],"Canvas","前端",{"category":5,"tags":137},[14,138,139,140],"GitHub Actions","Vite","部署",{"category":5,"tags":142},[135],{"category":5,"tags":144},[135,145],"系统设计",{"category":5,"tags":147},[135,148,149,150],"安全","XSS","CSRF",{"category":152,"tags":153},"项目",[134,154],"PixiJS",{"category":152,"tags":156},null,{"category":40,"tags":158},[42,159,160,161],"栈","队列","JavaScript",{"category":40,"tags":163},[42,164,161],"哈希表",{"category":5,"tags":166},[167,161,168],"ES6","Set",{"category":40,"tags":170},[40,171,172],"动态规划","背包问题",{"category":40,"tags":174},[40,175],"滑动窗口",{"category":40,"tags":177},[42,178,161],"链表",{"category":40,"tags":180},[40,181,161,182],"ACM","面试",{"category":40,"tags":184},[40,161,185],"数据类型转换",{"category":40,"tags":187},[42,188,178,189],"顺序表","TypeScript",{"category":5,"tags":191},[135,154,134,192],"渲染",{"category":5,"tags":194},[135,195,134,196],"富文本编辑","wangEditor",{"category":40,"tags":198},[199,40,178],"力扣",{"category":5,"tags":201},[202,203,204,91],"DNS","加密","网络安全",{"category":5,"tags":206},[135,207],"Axios",{"category":5,"tags":209},[135,207,189,210],"接口封装",{"category":5,"tags":212},[135,213,145],"JWT",{"category":152,"tags":215},[134,216,217,154,218],"画布","React","项目开发",{"category":17,"tags":220},[221],"日志",{"category":5,"tags":223},[224,225,226,227],"Neo4j","图数据库","中心度分析","PageRank",{"category":12,"tags":229},[230,231,232,233],"论文","机器学习","随机森林","保险欺诈",{"category":5,"tags":235},[236],"人工智能",{"category":5,"tags":238},[231,40,32],{"category":12,"tags":240},[241,242,243,244],"共识算法","最长链","区块链","算法设计",{"category":5,"tags":246},[161,247,248,135],"闭包","作用域",{"category":5,"tags":250},[14,138,251,252],"RSS","自动化",{"category":30,"tags":254},[89,90,91,255],"安装",{"category":30,"tags":257},[258,91,259],"MSYS2","开发环境",{"category":5,"tags":261},[262,263,264,265],"团队协作","Git","Commit规范","代码审查",{"category":30,"tags":267},[268,269,270],"oh-my-posh","终端美化","CLI",{"category":5,"tags":272},[273,274,275],"上下文工程","Agent","RAG",{"category":5,"tags":277},[278,279,280],"前端工程化","技术选型","工程基建",{"category":5,"tags":282},[275],{"category":5,"tags":284},[285,286],"SDD","规格驱动开发",{"category":5,"tags":288},[289],"neovim",{"category":5,"tags":291},[292],"技术写作",{"category":5,"tags":294},[295,32,296,89,297],"FastAPI","后端","工程实践",{"category":152,"tags":299},[274,300],"Harness Engineering",{"category":5,"tags":302},[303],"RFC",{"category":152,"tags":305},[274,300,275],{"category":152,"tags":307},[274],{"category":40,"tags":309},[199,40,161,310],"两数之和",{"category":40,"tags":312},[199,40,161,313],"双指针",{"category":40,"tags":315},[199,40,161,178],{"category":40,"tags":317},[199,40,161,175],{"category":40,"tags":319},[199,40,161,320],"回溯",{"category":5,"tags":322},[323,324,325,326],"分布式处理与计算","Spark","Scala","RDD",{"category":5,"tags":328},[323,329,330,331],"线性回归","逻辑回归","监督学习",{"category":5,"tags":333},[323,334,335,336],"数值优化","牛顿法","收敛性",{"category":5,"tags":338},[323,339,340,341],"PCA","数据降维","正则化",{"category":5,"tags":343},[323,344,345,346],"聚类","层次聚类","K-Means",{"category":5,"tags":348},[323,349,350,351],"随机模拟","统计推断","EM算法",{"category":5,"tags":353},[24],{"category":5,"tags":355},[24],{"category":5,"tags":357},[24],{"category":40,"tags":359},[42,360],"图论",{"category":40,"tags":362},[42,363,364],"树","二叉树",{"category":40,"tags":366},[42,160],{"category":40,"tags":368},[42],{"category":40,"tags":370},[42,159],{"category":40,"tags":372},[42,40,373],"复杂度分析",{"category":40,"tags":375},[42,43,178],{"category":40,"tags":377},[42,43,188],{"category":40,"tags":379},[42,380],"基础概念",{"category":17,"tags":382},[383,384,385],"随记","照片","高中",{"category":17,"tags":387},[383,388,389],"团建","战地",{"category":17,"tags":391},[383,392],"生活",{"category":17,"tags":394},[383,395],"文学",{"category":17,"tags":397},[383,398,399],"SCP","模因",{"category":17,"tags":401},[383,402,403],"画集","艺术",{"category":17,"tags":405},[14,406,383],"写作",{"category":17,"tags":408},[383,409,410],"音乐","摇滚",{"category":17,"tags":412},[383,392],{"category":17,"tags":414},[383,409],{"category":17,"tags":416},[383,35,392],{"category":17,"tags":418},[383,419,420],"同人","手书",{"category":17,"tags":422},[383,392],{"category":17,"tags":424},[383,392],{"category":17,"tags":426},[383,427],"植物",{"category":17,"tags":429},[383,430],"读书",{"category":17,"tags":432},[383,392],{"category":17,"tags":434},[383,392],{"category":17,"tags":436},[383,392],{"category":17,"tags":438},[383,392],{"category":17,"tags":440},[383,392],{"category":17,"tags":442},[383,392],{"category":17,"tags":444},[14,445,383],"一周年",{"category":17,"tags":447},[383,392],{"category":17,"tags":449},[383,392],{"category":17,"tags":451},[35,452,453],"开源组织","SITE-193",{"category":17,"tags":455},[383,392],{"category":17,"tags":457},[383,458],"年末",{"category":17,"tags":460},[383,392],{"category":17,"tags":462},[383,392],{"category":17,"tags":464},[14,17],{"category":17,"tags":466},[383,392],{"category":17,"tags":468},[383,392],{"category":17,"tags":470},[383,392],{"category":17,"tags":472},[383,392],{"category":17,"tags":474},[383,475,476],"游戏","Control",{"category":30,"tags":478},[479,480,481,482],"Quadim","图像处理","四叉树","Rust",{"category":17,"tags":484},[14,485],"上线纪念",{"category":17,"tags":487},[383,395],{"category":30,"tags":489},[203,490],"测试",{"category":17,"tags":492},[383],{"category":17,"tags":494},[383,392],{"category":17,"tags":496},[383],{"category":5,"tags":498},[40],{"category":5,"tags":500},[40],{"category":5,"tags":502},[40],{"category":5,"tags":504},[40],{"category":5,"tags":506},[40],[508,512,516,520,524,528,532,536,540,544,548,552,556,560,564,568,572,576,579,583,587,590,594,598,602,606,610,614,618,622,626,630,634,638,642,646,650,654,658,662,666,670,674,678,682,686,690,694,698,702,706,710,714,718,722,726,730,734,738,742,746,750,754,758,762,766,770,774,778,782,786,790,794,798,801,805,809,813,817,821,825,829,833,837,841,845,849,853,857,861,865,869,873,877,881,885,889,893,897,901,904,907,911,915,919,923,927,930,934,938,942,946,950,954,957,961,965,969,973,977,981,984,988,992,996,1000,1004,1007,1011,1015,1019,1023,1027,1031,1035,1039,1043,1047,1051,1055,1059,1063,1067,1071,1075,1079],{"path":509,"words":510,"published":511,"date":156},"\u002Fposts\u002F2024\u002F2024-06-25-liteloaderqqnt",1296,"2024-06-25 11:03:08",{"path":513,"words":514,"published":515,"date":156},"\u002Fposts\u002F2024\u002F2024-06-26-ip签名",0,"2024-06-26 22:53:53",{"path":517,"words":518,"published":519,"date":156},"\u002Fposts\u002F2024\u002F2024-06-29-何加盐中文互联网正在加速崩塌",4853,"2024-06-29 00:47:13",{"path":521,"words":522,"published":523,"date":156},"\u002Fposts\u002F2024\u002F2024-07-12-github-chart",270,"2024-07-12 20:02:50",{"path":525,"words":526,"published":527,"date":156},"\u002Fposts\u002F2024\u002F2024-07-14-访客数统计",192,"2024-07-24 01:34:28",{"path":529,"words":530,"published":531,"date":156},"\u002Fposts\u002F2024\u002F2024-07-26-广大选课脚本",110,"2024-07-26 01:34:28",{"path":533,"words":534,"published":535,"date":156},"\u002Fposts\u002F2024\u002F2024-07-26-数学分析笔记其二",14,"2024-07-26 23:54:02",{"path":537,"words":538,"published":539,"date":156},"\u002Fposts\u002F2024\u002F2024-07-26-数据结构复习其二",12856,"2024-07-26 02:48:08",{"path":541,"words":542,"published":543,"date":156},"\u002Fposts\u002F2024\u002F2024-07-26-数据结构复习相关",32856,"2024-07-26 02:24:14",{"path":545,"words":546,"published":547,"date":156},"\u002Fposts\u002F2024\u002F2024-07-26-线性代数与空间解析几何知识点全汇总",6110,"2024-07-26 03:27:55",{"path":549,"words":550,"published":551,"date":156},"\u002Fposts\u002F2024\u002F2024-07-31-typora-picgo-兰空图床打造markdown写作环境",311,"2024-07-31 12:56:23",{"path":553,"words":554,"published":555,"date":156},"\u002Fposts\u002F2024\u002F2024-09-02-jupyter配置中文",441,"2024-09-02 23:49:05",{"path":557,"words":558,"published":559,"date":156},"\u002Fposts\u002F2024\u002F2024-09-02-自定义vscode背景图片",100,"2024-09-02 23:39:00",{"path":561,"words":562,"published":563,"date":156},"\u002Fposts\u002F2024\u002F2024-09-03-制作gzhu校园网路由器",1423,"2024-09-03 23:43:18",{"path":565,"words":566,"published":567,"date":156},"\u002Fposts\u002F2024\u002F2024-09-26-09-25-2024",136,"2024-09-26 00:49:26",{"path":569,"words":570,"published":571,"date":156},"\u002Fposts\u002F2024\u002F2024-11-04-创建一个网络包解码器分析devp2p协议",1943,"2024-11-04 16:45:19",{"path":573,"words":574,"published":575,"date":156},"\u002Fposts\u002F2024\u002F2025-03-09-2024一些笔记常微分",16,"2024-12-09 22:51:00",{"path":577,"words":574,"published":578,"date":156},"\u002Fposts\u002F2024\u002F2025-03-09-2024一些笔记概率论","2025-03-09 22:51:00",{"path":580,"words":581,"published":582,"date":156},"\u002Fposts\u002F2025\u002F2025-03-01-windows下释放docker占用的wsl空间",164,"2025-03-01 13:54:15",{"path":584,"words":585,"published":586,"date":156},"\u002Fposts\u002F2025\u002F2025-03-01-爬虫实战-爬取广州大学课程表",774,"2025-03-01 14:55:48",{"path":588,"words":530,"published":589,"date":156},"\u002Fposts\u002F2025\u002F2025-04-03-hexo集成gitalk的问题","2025-04-03 14:26:34",{"path":591,"words":592,"published":593,"date":156},"\u002Fposts\u002F2025\u002F2025-09-22-记一次配置obsidian配合hexo写博客",92,"2025-09-22 16:47:52",{"path":595,"words":596,"published":597,"date":156},"\u002Fposts\u002F2025\u002F2025-10-24-10-20课题",204,"2025-10-24 08:15:01",{"path":599,"words":600,"published":601,"date":156},"\u002Fposts\u002F2025\u002F2025-11-02-组会朝花夕拾",501,"2025-11-02 18:56:59",{"path":603,"words":604,"published":605,"date":156},"\u002Fposts\u002F2025\u002F2025-11-05-基于随机加权推断模型im的参数估计算法",481,"2025-11-05 20:51:41",{"path":607,"words":608,"published":609,"date":156},"\u002Fposts\u002F2025\u002F2025-11-09-关于软考高项网规",884,"2025-11-09 19:54:52",{"path":611,"words":612,"published":613,"date":156},"\u002Fposts\u002F2025\u002F2025-11-17-arch-linux运行appimage相关",365,"2025-11-17 09:59:59",{"path":615,"words":616,"published":617,"date":156},"\u002Fposts\u002F2025\u002F2025-11-19-相关概念",2058,"2025-11-19 11:06:20",{"path":619,"words":620,"published":621,"date":156},"\u002Fposts\u002F2025\u002F2025-11-21-web可视化实践canvas",6393,"2025-11-21 14:50:48",{"path":623,"words":624,"published":625,"date":156},"\u002Fposts\u002F2025\u002F2025-11-22-使用-github-actions-自动部署基于vite的项目到-github-pages",272,"2025-11-23 01:59:24",{"path":627,"words":628,"published":629,"date":156},"\u002Fposts\u002F2025\u002F2025-11-22-关于前端包管理器npmpnpmyarn和bun",4890,"2025-11-22 21:21:15",{"path":631,"words":632,"published":633,"date":156},"\u002Fposts\u002F2025\u002F2025-11-23-undo-redo-机制具体实现",7839,"2025-11-23 19:15:00",{"path":635,"words":636,"published":637,"date":156},"\u002Fposts\u002F2025\u002F2025-11-27-前端安全-关于xss与crsf",1866,"2025-11-28 02:05:25",{"path":639,"words":640,"published":641,"date":156},"\u002Fposts\u002F2025\u002F2025-12-05-现代协同-2d-画布编辑器pixijs-v8",4285,"2025-12-05 02:00:16",{"path":643,"words":644,"published":645,"date":156},"\u002Fposts\u002F2025\u002F2025-12-07-杂谈-课题组系统设计",3710,"2025-12-07 21:09:33",{"path":647,"words":648,"published":649,"date":156},"\u002Fposts\u002F2025\u002F2025-12-25-javascript中的数组方法与栈stack和队列queue的实现",474,"2025-11-29 16:58:15",{"path":651,"words":652,"published":653,"date":156},"\u002Fposts\u002F2025\u002F2025-12-25-关于javascript-实现哈希表",189,"2025-11-27 11:31:39",{"path":655,"words":656,"published":657,"date":156},"\u002Fposts\u002F2025\u002F2025-12-25-关于javascript的set方法",332,"2025-12-25 15:26:18",{"path":659,"words":660,"published":661,"date":156},"\u002Fposts\u002F2025\u002F2025-12-25-关于动态规划(背包问题为例)",1238,"2025-11-17 18:24:04",{"path":663,"words":664,"published":665,"date":156},"\u002Fposts\u002F2025\u002F2025-12-25-关于滑动窗口",712,"2025-11-20 15:04:40",{"path":667,"words":668,"published":669,"date":156},"\u002Fposts\u002F2025\u002F2025-12-25-关于链表(javascript)",500,"2025-11-25 13:00:48",{"path":671,"words":672,"published":673,"date":156},"\u002Fposts\u002F2025\u002F2025-12-25-面试算法acm模式构建构建输入输出模板",2051,"2025-12-25 23:09:45",{"path":675,"words":676,"published":677,"date":156},"\u002Fposts\u002F2025\u002F2025-12-26-javascript-数字数组字符串的处理",483,"2025-12-26 11:20:25",{"path":679,"words":680,"published":681,"date":156},"\u002Fposts\u002F2025\u002F2025-12-26-javascripttypescript-的顺序表链表实现",446,"2025-12-26 12:16:12",{"path":683,"words":684,"published":685,"date":156},"\u002Fposts\u002F2025\u002F2025-12-27-前端画布设计vol-1-实现基础yuan素渲染和状态控制",2136,"2025-12-28 01:23:08",{"path":687,"words":688,"published":689,"date":156},"\u002Fposts\u002F2025\u002F2025-12-27-前端画布设计vol-2-实现富文本编辑",1838,"2025-12-28 02:58:47",{"path":691,"words":692,"published":693,"date":156},"\u002Fposts\u002F2025\u002F2025-12-27-算法刷题-关于链表操作",2135,"2025-12-27 16:12:42",{"path":695,"words":696,"published":697,"date":156},"\u002Fposts\u002F2025\u002F2025-12-27-配置dnscrypt-proxy实现加密dns服务windows",1899,"2025-11-15 01:06:37",{"path":699,"words":700,"published":701,"date":156},"\u002Fposts\u002F2025\u002F2025-12-28-前端-关于网络请求xhrajaxfetchaxios",7788,"2025-10-28 15:48:46",{"path":703,"words":704,"published":705,"date":156},"\u002Fposts\u002F2025\u002F2025-12-28-前端-接口封装与请求规范axios为例",2373,"2025-12-29 01:01:18",{"path":707,"words":708,"published":709,"date":156},"\u002Fposts\u002F2025\u002F2025-12-28-前端-身份验证管理-基于-jwt-token-的实现",2709,"2025-11-23 22:04:41",{"path":711,"words":712,"published":713,"date":156},"\u002Fposts\u002F2025\u002F2025-12-29-记canvas画布项目开发",6254,"2025-12-29 04:52:15",{"path":715,"words":716,"published":717,"date":156},"\u002Fposts\u002F2025\u002Fabout-site",116,"2025-03-31 16:44:24",{"path":719,"words":720,"published":721,"date":156},"\u002Fposts\u002F2025\u002F使用neo4j图数据科学库gds进行中心度分析",143,"2025-04-02 23:37:24",{"path":723,"words":724,"published":725,"date":156},"\u002Fposts\u002F2026\u002F2026-01-03-论文实训草稿",10445,"2026-01-03 14:10:49",{"path":727,"words":728,"published":729,"date":156},"\u002Fposts\u002F2026\u002F2026-01-06-人工智能导论",11461,"2026-01-07 03:25:49",{"path":731,"words":732,"published":733,"date":156},"\u002Fposts\u002F2026\u002F2026-01-07-机器学习相关算法",82,"2026-01-08 02:28:13",{"path":735,"words":736,"published":737,"date":156},"\u002Fposts\u002F2026\u002F2026-01-16-关于低复杂度最长链共识算法设计",4466,"2026-01-16 10:33:23",{"path":739,"words":740,"published":741,"date":156},"\u002Fposts\u002F2026\u002F2026-01-19-杂记2026-01-19",5754,"2026-01-20 01:03:26",{"path":743,"words":744,"published":745,"date":156},"\u002Fposts\u002F2026\u002F2026-01-22-github-action-自动同步博客到-github-主页",1069,"2026-01-22 16:31:47",{"path":747,"words":748,"published":749,"date":156},"\u002Fposts\u002F2026\u002F2026-03-01-windows-wsl安装docker",257,"2026-03-01 20:55:31",{"path":751,"words":752,"published":753,"date":156},"\u002Fposts\u002F2026\u002F2026-03-14-关于-msys2",701,"2026-03-15 03:05:04",{"path":755,"words":756,"published":757,"date":156},"\u002Fposts\u002F2026\u002F2026-03-28-团队项目协作规范随记",2419,"2026-03-29 05:33:50",{"path":759,"words":760,"published":761,"date":156},"\u002Fposts\u002F2026\u002F2026-03-29-oh-my-posh配置分享",104,"2026-03-29 16:34:43",{"path":763,"words":764,"published":765,"date":156},"\u002Fposts\u002F2026\u002F2026-06-13-从上下文工程到-agent-harness-engineering",8840,"2026-06-13 21:06:20",{"path":767,"words":768,"published":769,"date":156},"\u002Fposts\u002F2026\u002F2026-07-13-简谈前端基建质量标准与ai友好建设",3814,"2026-07-13 21:06:20",{"path":771,"words":772,"published":773,"date":156},"\u002Fposts\u002F2026\u002F2026-07-15-agentic-rag-系统实践",13357,"2026-07-15 21:06:20",{"path":775,"words":776,"published":777,"date":156},"\u002Fposts\u002F2026\u002F2026-07-18-简谈sdd规范驱动开发-copy",4476,"2026-07-18 11:06:20",{"path":779,"words":780,"published":781,"date":156},"\u002Fposts\u002F2026\u002F2026-07-20-个人neovim配置分享",366,"2026-07-22 13:46:50",{"path":783,"words":784,"published":785,"date":156},"\u002Fposts\u002F2026\u002F2026-07-20-关于技术写作-设计文档",6763,"2026-07-20 13:46:50",{"path":787,"words":788,"published":789,"date":156},"\u002Fposts\u002F2026\u002F2026-07-29-fastapi-工程实践随记",3417,"2026-07-29 04:58:34",{"path":791,"words":792,"published":793,"date":156},"\u002Fposts\u002Frfc_agentic_project\u002F2026-06-19-rfc-liskin_code_agent",3563,"2026-06-19 15:18:20",{"path":795,"words":796,"published":797,"date":156},"\u002Fposts\u002Frfc_agentic_project\u002F2026-07-25-rfc-glushkov_ogas",13461,"2026-07-28 23:46:50",{"path":799,"words":800,"published":793,"date":156},"\u002Fposts\u002Frfc_agentic_project\u002F2026-08-03-adr-ogas-arkhiv",2698,{"path":802,"words":803,"published":804,"date":156},"\u002Fposts\u002Frfc_agentic_project\u002Frag\u002F2026-08-12-arkhiv_rag-vol-1",4366,"2026-08-12 15:18:20",{"path":806,"words":807,"published":808,"date":156},"\u002Fposts\u002Fleetcode\u002F2025-12-25-力扣百题速练javascripttypescriptvol-1",3108,"2025-12-25 13:57:08",{"path":810,"words":811,"published":812,"date":156},"\u002Fposts\u002Fleetcode\u002F2025-12-26-力扣百题速练javascripttypescriptvol-2",3185,"2025-12-26 13:57:08",{"path":814,"words":815,"published":816,"date":156},"\u002Fposts\u002Fleetcode\u002F2025-12-28-力扣百题速练javascripttypescriptvol-3",2533,"2025-12-29 02:15:44",{"path":818,"words":819,"published":820,"date":156},"\u002Fposts\u002Fleetcode\u002F2026-01-17-力扣百题速练javascripttypescriptvol-4",3024,"2026-01-17 22:53:01",{"path":822,"words":823,"published":824,"date":156},"\u002Fposts\u002Fleetcode\u002F2026-01-19-力扣百题速练javascripttypescriptvol-5",293,"2026-01-19 15:15:12",{"path":826,"words":827,"published":828,"date":156},"\u002Fposts\u002F分布式处理与计算\u002F分布式处理与计算spark系统与scala语言",4320,"2026-07-06 14:10:49",{"path":830,"words":831,"published":832,"date":156},"\u002Fposts\u002F分布式处理与计算\u002F分布式处理与计算分类与回归分析",2081,"2026-07-07 12:40:29",{"path":834,"words":835,"published":836,"date":156},"\u002Fposts\u002F分布式处理与计算\u002F分布式处理与计算数值优化方法",2182,"2026-07-07 13:50:29",{"path":838,"words":839,"published":840,"date":156},"\u002Fposts\u002F分布式处理与计算\u002F分布式处理与计算数据降维",1583,"2026-07-07 21:50:29",{"path":842,"words":843,"published":844,"date":156},"\u002Fposts\u002F分布式处理与计算\u002F分布式处理与计算聚类分析",1882,"2026-07-07 16:50:29",{"path":846,"words":847,"published":848,"date":156},"\u002Fposts\u002F分布式处理与计算\u002F分布式处理与计算随机模拟与统计推断",2433,"2026-07-06 22:40:29",{"path":850,"words":851,"published":852,"date":156},"\u002Fposts\u002F数据可视化\u002F2026-06-14-数据可视化-基本图像",10011,"2026-06-14 20:18:20",{"path":854,"words":855,"published":856,"date":156},"\u002Fposts\u002F数据可视化\u002F2026-06-14-数据可视化-概论",10030,"2026-06-14 15:18:20",{"path":858,"words":859,"published":860,"date":156},"\u002Fposts\u002F数据可视化\u002F2026-06-15-数据可视化-可视化库",2032,"2026-06-15 20:18:20",{"path":862,"words":863,"published":864,"date":156},"\u002Fposts\u002F数据结构\u002F2025-09-29-数据结构-图",5451,"2025-04-15 20:48:06",{"path":866,"words":867,"published":868,"date":156},"\u002Fposts\u002F数据结构\u002F2025-09-29-数据结构-树",4211,"2025-04-30 02:19:06",{"path":870,"words":871,"published":872,"date":156},"\u002Fposts\u002F数据结构\u002F2025-09-29-数据结构-队列",921,"2025-04-11 15:30:08",{"path":874,"words":875,"published":876,"date":156},"\u002Fposts\u002F数据结构\u002F关于数据结构的一些想法",456,"2025-04-04 19:13:49",{"path":878,"words":879,"published":880,"date":156},"\u002Fposts\u002F数据结构\u002F数据结构-栈",920,"2025-04-18 00:17:37",{"path":882,"words":883,"published":884,"date":156},"\u002Fposts\u002F数据结构\u002F数据结构-算法复杂度",2153,"2025-04-05 16:09:55",{"path":886,"words":887,"published":888,"date":156},"\u002Fposts\u002F数据结构\u002F数据结构-线性表链表",4572,"2025-04-06 00:24:40",{"path":890,"words":891,"published":892,"date":156},"\u002Fposts\u002F数据结构\u002F数据结构-线性表顺序表",4191,"2025-04-05 22:09:59",{"path":894,"words":895,"published":896,"date":156},"\u002Fposts\u002F数据结构\u002F数据结构-绪论",2881,"2025-04-05 11:31:22",{"path":898,"words":899,"published":156,"date":900},"\u002Fposts\u002F杂记\u002F2023-12-26-2023年12月26日",7,"2023-12-26 23:51:33",{"path":902,"words":899,"published":156,"date":903},"\u002Fposts\u002F杂记\u002F2024-01-01-2024团建","2024-01-01 01:51:27",{"path":905,"words":581,"published":156,"date":906},"\u002Fposts\u002F杂记\u002F2024-01-09-随记","2024-01-09 20:50:35",{"path":908,"words":909,"published":156,"date":910},"\u002Fposts\u002F杂记\u002F2024-03-12-花名",5275,"2024-03-12 16:04:23",{"path":912,"words":913,"published":156,"date":914},"\u002Fposts\u002F杂记\u002F2024-04-15-逆模因",1353,"2024-04-15 00:26:16",{"path":916,"words":917,"published":156,"date":918},"\u002Fposts\u002F杂记\u002F2024-05-03-艺作",27,"2024-05-03 00:01:00",{"path":920,"words":921,"published":156,"date":922},"\u002Fposts\u002F杂记\u002F2024-05-21-关于博客",1720,"2024-02-21 23:21:11",{"path":924,"words":925,"published":156,"date":926},"\u002Fposts\u002F杂记\u002F2024-06-20-dnvrc维克多崔专访-2023",2036,"2024-06-20 00:28:39",{"path":928,"words":760,"published":156,"date":929},"\u002Fposts\u002F杂记\u002F2024-06-25-6月25日随记","2024-06-25 12:46:36",{"path":931,"words":932,"published":156,"date":933},"\u002Fposts\u002F杂记\u002F2024-06-25-歌名-想見星星",148,"2024-06-25 22:47:59",{"path":935,"words":936,"published":156,"date":937},"\u002Fposts\u002F杂记\u002F2024-07-11-桂花岗",6,"2024-07-11 00:28:17",{"path":939,"words":940,"published":156,"date":941},"\u002Fposts\u002F杂记\u002F2024-07-15-rolling-bocci",9,"2024-07-15 21:25:56",{"path":943,"words":944,"published":156,"date":945},"\u002Fposts\u002F杂记\u002F2024-07-22-七月九日",34,"2024-07-09 17:54:23",{"path":947,"words":948,"published":156,"date":949},"\u002Fposts\u002F杂记\u002F2024-07-22-六月随记",1052,"2024-07-22 01:03:19",{"path":951,"words":952,"published":156,"date":953},"\u002Fposts\u002F杂记\u002F2024-07-22-石菖蒲",41,"2024-07-10 01:26:05",{"path":955,"words":514,"published":156,"date":956},"\u002Fposts\u002F杂记\u002F2024-07-23-新书","2024-07-23 01:05:49",{"path":958,"words":959,"published":156,"date":960},"\u002Fposts\u002F杂记\u002F2024-07-29-年前",74,"2024-07-29 23:59:07",{"path":962,"words":963,"published":156,"date":964},"\u002Fposts\u002F杂记\u002F2024-07-30-周边",138,"2024-07-30 02:03:23",{"path":966,"words":967,"published":156,"date":968},"\u002Fposts\u002F杂记\u002F2024-07-31-2024-7-31日",185,"2024-07-31 01:21:52",{"path":970,"words":971,"published":156,"date":972},"\u002Fposts\u002F杂记\u002F2024-08-02-八月",1710,"2024-08-30 00:31:02",{"path":974,"words":975,"published":156,"date":976},"\u002Fposts\u002F杂记\u002F2024-09-01-九月",1484,"2024-09-26 16:30:15",{"path":978,"words":979,"published":156,"date":980},"\u002Fposts\u002F杂记\u002F2024-09-08-2024年9月8日",97,"2024-09-08 13:59:36",{"path":982,"words":514,"published":156,"date":983},"\u002Fposts\u002F杂记\u002F2024-09-19-博客站的一周年","2024-09-18 23:36:24",{"path":985,"words":986,"published":156,"date":987},"\u002Fposts\u002F杂记\u002F2024-10-03-十月",1028,"2024-10-31 23:54:27",{"path":989,"words":990,"published":156,"date":991},"\u002Fposts\u002F杂记\u002F2024-11-04-十一月",2134,"2024-11-30 00:04:39",{"path":993,"words":994,"published":156,"date":995},"\u002Fposts\u002F杂记\u002F2024-11-10-gzhu-site-193",80,"2024-11-10 19:19:12",{"path":997,"words":998,"published":156,"date":999},"\u002Fposts\u002F杂记\u002F2024-12-01-十二月",455,"2024-12-30 23:13:47",{"path":1001,"words":1002,"published":156,"date":1003},"\u002Fposts\u002F杂记\u002F2024-12-21-年末",23,"2024-12-21 23:21:49",{"path":1005,"words":522,"published":156,"date":1006},"\u002Fposts\u002F杂记\u002F2025-01-30-一月","2025-01-30 23:44:41",{"path":1008,"words":1009,"published":156,"date":1010},"\u002Fposts\u002F杂记\u002F2025-03-01-二月",224,"2025-02-28 00:11:08",{"path":1012,"words":1013,"published":156,"date":1014},"\u002Fposts\u002F杂记\u002F2025-03-01-博客杂谈",344,"2025-03-01 16:03:18",{"path":1016,"words":1017,"published":156,"date":1018},"\u002Fposts\u002F杂记\u002F2025-03-05-三月",2090,"2025-03-05 19:17:28",{"path":1020,"words":1021,"published":156,"date":1022},"\u002Fposts\u002F杂记\u002F2025-07-10-七月",361,"2025-07-10 22:04:32",{"path":1024,"words":1025,"published":156,"date":1026},"\u002Fposts\u002F杂记\u002F2025-09-21-九月",781,"2025-09-21 20:53:37",{"path":1028,"words":1029,"published":156,"date":1030},"\u002Fposts\u002F杂记\u002F2025-10-09-十月",591,"2025-10-09 00:35:07",{"path":1032,"words":1033,"published":156,"date":1034},"\u002Fposts\u002F杂记\u002Fcontrol",13,"2023-09-25 13:03:59",{"path":1036,"words":1037,"published":156,"date":1038},"\u002Fposts\u002F杂记\u002Fquadim四叉树图像处理",1094,"2023-10-21 11:27:06",{"path":1040,"words":1041,"published":156,"date":1042},"\u002Fposts\u002F杂记\u002Fsuccess",24,"2023-09-22 15:59:07",{"path":1044,"words":1045,"published":156,"date":1046},"\u002Fposts\u002F杂记\u002F三光年",295,"2023-11-18 04:18:40",{"path":1048,"words":1049,"published":156,"date":1050},"\u002Fposts\u002F杂记\u002F加密测试",961,"2023-11-21 14:24:01",{"path":1052,"words":1053,"published":156,"date":1054},"\u002Fposts\u002F杂记\u002F啊啊啊啊啊啊啊",54,"2023-09-20 17:29:33",{"path":1056,"words":1057,"published":156,"date":1058},"\u002Fposts\u002F杂记\u002F杂谈",124,"2023-09-25 23:11:32",{"path":1060,"words":1061,"published":156,"date":1062},"\u002Fposts\u002F杂记\u002F艹",25,"2023-10-21 17:40:43",{"path":1064,"words":1065,"published":1066,"date":156},"\u002Fposts\u002F神经网络\u002F神经网络与深度学习卷积神经网络",3168,"2026-06-07 11:23:08",{"path":1068,"words":1069,"published":1070,"date":156},"\u002Fposts\u002F神经网络\u002F神经网络与深度学习循环神经网络",2348,"2026-06-07 11:33:08",{"path":1072,"words":1073,"published":1074,"date":156},"\u002Fposts\u002F神经网络\u002F神经网络与深度学习改进学习方法",3360,"2026-06-07 10:13:08",{"path":1076,"words":1077,"published":1078,"date":156},"\u002Fposts\u002F神经网络\u002F神经网络与深度学习深度生成模型",2727,"2026-06-07 11:43:08",{"path":1080,"words":1081,"published":1082,"date":156},"\u002Fposts\u002F神经网络\u002F神经网络与深度学习神经网络基础",3205,"2026-06-07 10:03:08",{"id":1084,"title":1085,"abbrlink":1086,"body":1087,"category":40,"cover":156,"date":156,"description":1093,"extension":1242,"mathjax":1243,"meta":1244,"navigation":1243,"path":679,"published":681,"readingMinutes":1247,"seo":1248,"stem":1249,"sticky":156,"swiper_index":156,"tags":1250,"updated":156,"words":680,"__hash__":1251},"posts\u002Fposts\u002F2025\u002F2025-12-26-Javascript，TypeScript 的顺序表，链表实现.md","2025-12-26-Javascript\u002FTypeScript 的顺序表，链表实现","46758",{"type":1088,"value":1089,"toc":1227},"minimark",[1090,1094,1097,1102,1105,1115,1118,1124,1128,1131,1137,1140,1142,1146,1158,1163,1169,1173,1176,1183,1186,1189,1193,1199,1202,1210,1213],[1091,1092,1093],"p",{},"JavaScript 原生提供了 Array 作为高效的动态顺序表实现，但为了理解底层原理，通常需要手动实现。链表则需要完全手动实现，因为 JavaScript 无内置链表结构。",[1091,1095,1096],{},"以下分别提供两种数据结构的完整实现，包括基本操作（插入、删除、查找、遍历等），并附带说明。",[1098,1099,1101],"h2",{"id":1100},"_1-顺序表基于数组的动态顺序表","1. 顺序表（基于数组的动态顺序表）",[1091,1103,1104],{},"顺序表的核心是连续存储，使用数组实现",[1106,1107,1112],"pre",{"className":1108,"code":1110,"language":161,"meta":1111},[1109],"language-JavaScript","\u002F\u002F 创建顺序表\nconst seqList = [];\n\n\u002F\u002F 添加元素\nseqList.push(10);\nseqList.push(20);\nseqList.push(30);\n\n\u002F\u002F 在索引 1 处插入 15\nseqList.splice(1, 0, 15);  \u002F\u002F [10, 15, 20, 30]\n\n\u002F\u002F 修改索引 2 处的元素\nseqList[2] = 25;           \u002F\u002F [10, 15, 25, 30]\n\n\u002F\u002F 删除索引 0 处的元素\nseqList.splice(0, 1);      \u002F\u002F [15, 25, 30]\n\n\u002F\u002F 输出长度和内容\nconsole.log('长度:', seqList.length);  \u002F\u002F 3\nconsole.log('内容:', seqList);         \u002F\u002F [15, 25, 30]\n","",[1113,1114,1110],"code",{"__ignoreMap":1111},[1091,1116,1117],{},"手动实现如下：",[1106,1119,1122],{"className":1120,"code":1121,"language":161,"meta":1111},[1109],"class SequentialList {\n    constructor(capacity = 10) {\n        this.data = new Array(capacity);  \u002F\u002F 存储元素\n        this.size = 0;                    \u002F\u002F 当前元素个数\n        this.capacity = capacity;         \u002F\u002F 当前容量\n    }\n\n    \u002F\u002F 获取长度\n    getSize() {\n        return this.size;\n    }\n\n    \u002F\u002F 判断是否为空\n    isEmpty() {\n        return this.size === 0;\n    }\n\n    \u002F\u002F 扩容（当 size === capacity 时）\n    resize(newCapacity) {\n        const newData = new Array(newCapacity);\n        for (let i = 0; i \u003C this.size; i++) {\n            newData[i] = this.data[i];\n        }\n        this.data = newData;\n        this.capacity = newCapacity;\n    }\n\n    \u002F\u002F 在索引 index 处插入元素\n    add(index, element) {\n        if (index \u003C 0 || index > this.size) {\n            throw new Error('索引越界');\n        }\n        if (this.size === this.capacity) {\n            this.resize(this.capacity * 2);  \u002F\u002F 扩容为两倍\n        }\n        \u002F\u002F 从后向前移动元素\n        for (let i = this.size - 1; i >= index; i--) {\n            this.data[i + 1] = this.data[i];\n        }\n        this.data[index] = element;\n        this.size++;\n    }\n\n    \u002F\u002F 在末尾添加元素\n    append(element) {\n        this.add(this.size, element);\n    }\n\n    \u002F\u002F 删除索引 index 处的元素并返回\n    remove(index) {\n        if (index \u003C 0 || index >= this.size) {\n            throw new Error('索引越界');\n        }\n        const removed = this.data[index];\n        \u002F\u002F 从前向后移动元素\n        for (let i = index + 1; i \u003C this.size; i++) {\n            this.data[i - 1] = this.data[i];\n        }\n        this.size--;\n        \u002F\u002F 可选：缩容（避免频繁缩容，通常当 size == capacity \u002F 4 时缩为一半）\n        if (this.size > 0 && this.size === Math.floor(this.capacity \u002F 4)) {\n            this.resize(Math.floor(this.capacity \u002F 2));\n        }\n        return removed;\n    }\n\n    \u002F\u002F 获取索引处元素\n    get(index) {\n        if (index \u003C 0 || index >= this.size) {\n            throw new Error('索引越界');\n        }\n        return this.data[index];\n    }\n\n    \u002F\u002F 设置索引处元素\n    set(index, element) {\n        if (index \u003C 0 || index >= this.size) {\n            throw new Error('索引越界');\n        }\n        this.data[index] = element;\n    }\n\n    \u002F\u002F 遍历打印\n    print() {\n        let str = 'SequentialList: [';\n        for (let i = 0; i \u003C this.size; i++) {\n            str += this.data[i];\n            if (i !== this.size - 1) str += ', ';\n        }\n        str += ']';\n        console.log(str);\n    }\n}\n\n\u002F\u002F 使用示例\nconst seqList = new SequentialList();\nseqList.append(1);\nseqList.append(2);\nseqList.add(1, 3);\nseqList.print();  \u002F\u002F SequentialList: [1, 3, 2]\n",[1113,1123,1121],{"__ignoreMap":1111},[1098,1125,1127],{"id":1126},"_2-链表单向链表","2. 链表（单向链表）",[1091,1129,1130],{},"链表使用节点分散存储，支持高效的插入和删除（O(1)），但随机访问较慢（O(n)）",[1106,1132,1135],{"className":1133,"code":1134,"language":161,"meta":1111},[1109],"\u002F\u002F 节点类\nclass ListNode {\n    constructor(val = null, next = null) {\n        this.val = val;\n        this.next = next;\n    }\n}\n\nclass LinkedList {\n    constructor() {\n        this.head = new ListNode();  \u002F\u002F 虚拟头结点，便于操作\n        this.size = 0;\n    }\n\n    getSize() {\n        return this.size;\n    }\n\n    isEmpty() {\n        return this.size === 0;\n    }\n\n    \u002F\u002F 在索引 index 处插入元素\n    add(index, element) {\n        if (index \u003C 0 || index > this.size) {\n            throw new Error('索引越界');\n        }\n        let prev = this.head;\n        for (let i = 0; i \u003C index; i++) {\n            prev = prev.next;\n        }\n        const node = new ListNode(element);\n        node.next = prev.next;\n        prev.next = node;\n        this.size++;\n    }\n\n    \u002F\u002F 在链表头部添加元素\n    addFirst(element) {\n        this.add(0, element);\n    }\n\n    \u002F\u002F 在链表末尾添加元素\n    addLast(element) {\n        this.add(this.size, element);\n    }\n\n    \u002F\u002F 获取索引处元素\n    get(index) {\n        if (index \u003C 0 || index >= this.size) {\n            throw new Error('索引越界');\n        }\n        let cur = this.head.next;\n        for (let i = 0; i \u003C index; i++) {\n            cur = cur.next;\n        }\n        return cur.val;\n    }\n\n    \u002F\u002F 设置索引处元素\n    set(index, element) {\n        if (index \u003C 0 || index >= this.size) {\n            throw new Error('索引越界');\n        }\n        let cur = this.head.next;\n        for (let i = 0; i \u003C index; i++) {\n            cur = cur.next;\n        }\n        cur.val = element;\n    }\n\n    \u002F\u002F 删除索引处元素并返回\n    remove(index) {\n        if (index \u003C 0 || index >= this.size) {\n            throw new Error('索引越界');\n        }\n        let prev = this.head;\n        for (let i = 0; i \u003C index; i++) {\n            prev = prev.next;\n        }\n        const removedNode = prev.next;\n        prev.next = removedNode.next;\n        removedNode.next = null;\n        this.size--;\n        return removedNode.val;\n    }\n\n    \u002F\u002F 遍历打印\n    print() {\n        let str = 'LinkedList: [';\n        let cur = this.head.next;\n        while (cur) {\n            str += cur.val;\n            if (cur.next) str += ' -> ';\n            cur = cur.next;\n        }\n        str += ']';\n        console.log(str);\n    }\n}\n\n\u002F\u002F 使用示例\nconst linkedList = new LinkedList();\nlinkedList.addLast(1);\nlinkedList.addLast(2);\nlinkedList.add(1, 3);\nlinkedList.print();  \u002F\u002F LinkedList: [1 -> 3 -> 2]\n",[1113,1136,1134],{"__ignoreMap":1111},[1138,1139],"hr",{},[1138,1141],{},[1098,1143,1145],{"id":1144},"lru-缓存的实现使用双向链表-hashmap","LRU 缓存的实现（使用双向链表 + HashMap）",[1091,1147,1148,1149,1153,1154,1157],{},"LRU（Least Recently Used）缓存是一种常见的数据结构，用于实现固定容量缓存，当容量满时淘汰最近最少使用的元素。在 JavaScript 中，最高效的实现方式是结合",[1150,1151,1152],"strong",{},"双向链表","（控制访问顺序）和",[1150,1155,1156],{},"Map","（或对象）作为哈希表（实现 O(1) 访问）",[1159,1160,1162],"h3",{"id":1161},"js实现","JS实现：",[1106,1164,1167],{"className":1165,"code":1166,"language":161,"meta":1111},[1109],"class LRUCache {\n    \u002F**\n     * 构造函数\n     * @param {number} capacity - 缓存的最大容量\n     *\u002F\n    constructor(capacity) {\n        this.capacity = capacity;        \u002F\u002F 缓存容量\n        this.cache = new Map();          \u002F\u002F 使用 Map 作为哈希表，保持插入顺序并支持 O(1) 操作\n        this.head = {};                  \u002F\u002F 双向链表的虚拟头节点\n        this.tail = {};                  \u002F\u002F 双向链表的虚拟尾节点\n        this.head.next = this.tail;      \u002F\u002F 初始化链表：head \u003C-> tail\n        this.tail.prev = this.head;\n    }\n\n    \u002F**\n     * 将节点移动到链表头部（表示最近使用）\n     * @private\n     * @param {Object} node - 要移动的节点\n     *\u002F\n    _moveToHead(node) {\n        \u002F\u002F 先从当前位置移除\n        node.prev.next = node.next;\n        node.next.prev = node.prev;\n\n        \u002F\u002F 插入到头部\n        node.next = this.head.next;\n        node.prev = this.head;\n        this.head.next.prev = node;\n        this.head.next = node;\n    }\n\n    \u002F**\n     * 从链表尾部移除节点（淘汰最久未使用的）\n     * @private\n     * @returns {Object} 被移除的节点\n     *\u002F\n    _removeTail() {\n        const lastNode = this.tail.prev;\n        lastNode.prev.next = this.tail;\n        this.tail.prev = lastNode.prev;\n        return lastNode;\n    }\n\n    \u002F**\n     * 获取缓存值\n     * @param {any} key - 键\n     * @returns {any} 值，如果不存在返回 -1\n     *\u002F\n    get(key) {\n        const node = this.cache.get(key);\n        if (!node) {\n            return -1;  \u002F\u002F 未找到\n        }\n        \u002F\u002F 刷新访问顺序：将节点移到头部\n        this._moveToHead(node);\n        return node.value;\n    }\n\n    \u002F**\n     * 放入缓存\n     * @param {any} key - 键\n     * @param {any} value - 值\n     *\u002F\n    put(key, value) {\n        const existingNode = this.cache.get(key);\n\n        if (existingNode) {\n            \u002F\u002F 已存在：更新值并移到头部\n            existingNode.value = value;\n            this._moveToHead(existingNode);\n        } else {\n            \u002F\u002F 不存在：创建新节点\n            const newNode = { key, value, prev: null, next: null };\n            this.cache.set(key, newNode);\n\n            \u002F\u002F 插入到头部\n            newNode.next = this.head.next;\n            newNode.prev = this.head;\n            this.head.next.prev = newNode;\n            this.head.next = newNode;\n\n            \u002F\u002F 检查容量是否超出\n            if (this.cache.size > this.capacity) {\n                const tailNode = this._removeTail();  \u002F\u002F 移除尾部节点\n                this.cache.delete(tailNode.key);      \u002F\u002F 从哈希表中删除\n            }\n        }\n    }\n\n    \u002F\u002F 可选：打印当前缓存顺序（用于调试）\n    printCache() {\n        const result = [];\n        let current = this.head.next;\n        while (current !== this.tail) {\n            result.push(`${current.key}:${current.value}`);\n            current = current.next;\n        }\n        console.log('LRU Cache (most recent -> least recent):', result.join(' -> '));\n    }\n}\n\n\u002F\u002F 使用示例\nconst cache = new LRUCache(3);\ncache.put(1, 1);\ncache.put(2, 2);\ncache.put(3, 3);\ncache.printCache();  \u002F\u002F 3:3 -> 2:2 -> 1:1\n\nconsole.log(cache.get(2));  \u002F\u002F 2（刷新顺序）\ncache.printCache();         \u002F\u002F 2:2 -> 3:3 -> 1:1\n\ncache.put(4, 4);            \u002F\u002F 容量满，淘汰最久未使用的 1\ncache.printCache();         \u002F\u002F 4:4 -> 2:2 -> 3:3\n",[1113,1168,1166],{"__ignoreMap":1111},[1159,1170,1172],{"id":1171},"ts实现","TS实现",[1091,1174,1175],{},"使用双向链表结合 Map（Map 在 TypeScript 中天然支持泛型）实现 O(1) 时间复杂度的 get 和 put 操作",[1106,1177,1181],{"className":1178,"code":1180,"language":189,"meta":1111},[1179],"language-TypeScript","\u002F\u002F 双向链表节点接口\ninterface Node\u003CK, V> {\n    key: K;\n    value: V;\n    prev: Node\u003CK, V> | null;\n    next: Node\u003CK, V> | null;\n}\n\nclass LRUCache\u003CK = number, V = number> {\n    private capacity: number;                \u002F\u002F 缓存容量\n    private cache: Map\u003CK, Node\u003CK, V>>;        \u002F\u002F 哈希表：键到节点的映射\n    private head: Node\u003CK, V>;                \u002F\u002F 虚拟头节点\n    private tail: Node\u003CK, V>;                \u002F\u002F 虚拟尾节点\n\n    constructor(capacity: number) {\n        this.capacity = capacity;\n        this.cache = new Map\u003CK, Node\u003CK, V>>();\n        this.head = { key: null as any, value: null as any, prev: null, next: null };\n        this.tail = { key: null as any, value: null as any, prev: null, next: null };\n        this.head.next = this.tail;\n        this.tail.prev = this.head;\n    }\n\n    \u002F\u002F 将节点移动到头部（最近使用）\n    private moveToHead(node: Node\u003CK, V>): void {\n        \u002F\u002F 从当前位置移除\n        node.prev!.next = node.next;\n        node.next!.prev = node.prev!;\n\n        \u002F\u002F 插入头部\n        node.next = this.head.next;\n        node.prev = this.head;\n        this.head.next!.prev = node;\n        this.head.next = node;\n    }\n\n    \u002F\u002F 移除尾部节点（最久未使用）\n    private removeTail(): Node\u003CK, V> {\n        const lastNode = this.tail.prev!;\n        lastNode.prev!.next = this.tail;\n        this.tail.prev = lastNode.prev;\n        return lastNode;\n    }\n\n    \u002F\u002F 获取值\n    get(key: K): V | -1 {\n        const node = this.cache.get(key);\n        if (!node) {\n            return -1;\n        }\n        this.moveToHead(node);  \u002F\u002F 刷新访问顺序\n        return node.value;\n    }\n\n    \u002F\u002F 放入键值对\n    put(key: K, value: V): void {\n        const existingNode = this.cache.get(key);\n\n        if (existingNode) {\n            existingNode.value = value;  \u002F\u002F 更新值\n            this.moveToHead(existingNode);\n        } else {\n            const newNode: Node\u003CK, V> = { key, value, prev: null, next: null };\n            this.cache.set(key, newNode);\n\n            \u002F\u002F 插入头部\n            newNode.next = this.head.next;\n            newNode.prev = this.head;\n            this.head.next!.prev = newNode;\n            this.head.next = newNode;\n\n            \u002F\u002F 超出容量时淘汰\n            if (this.cache.size > this.capacity) {\n                const tailNode = this.removeTail();\n                this.cache.delete(tailNode.key);\n            }\n        }\n    }\n\n    \u002F\u002F 调试：打印缓存顺序（最近 -> 最久）\n    printCache(): void {\n        const result: string[] = [];\n        let current = this.head.next;\n        while (current !== this.tail) {\n            result.push(`${current!.key}:${current!.value}`);\n            current = current!.next;\n        }\n        console.log('LRU Cache:', result.join(' -> '));\n    }\n}\n\n\u002F\u002F 使用示例\nconst cache = new LRUCache\u003Cnumber, number>(3);\ncache.put(1, 1);\ncache.put(2, 2);\ncache.put(3, 3);\ncache.printCache();  \u002F\u002F 3:3 -> 2:2 -> 1:1\nconsole.log(cache.get(2));  \u002F\u002F 2\ncache.printCache();         \u002F\u002F 2:2 -> 3:3 -> 1:1\n",[1113,1182,1180],{"__ignoreMap":1111},[1098,1184,1185],{"id":1185},"链表反转的实现",[1091,1187,1188],{},"单向链表的反转实现，包括迭代和递归两种方式",[1159,1190,1192],{"id":1191},"js实现-1","JS实现",[1106,1194,1197],{"className":1195,"code":1196,"language":161,"meta":1111},[1109],"\u002F\u002F 单向链表节点定义\nclass ListNode {\n    constructor(val = null, next = null) {\n        this.val = val;\n        this.next = next;\n    }\n}\n\n\u002F\u002F 创建链表的辅助函数\nfunction createLinkedList(arr) {\n    if (arr.length === 0) return null;\n    let head = new ListNode(arr[0]);\n    let current = head;\n    for (let i = 1; i \u003C arr.length; i++) {\n        current.next = new ListNode(arr[i]);\n        current = current.next;\n    }\n    return head;\n}\n\n\u002F\u002F 打印链表的辅助函数\nfunction printLinkedList(head) {\n    const result = [];\n    let current = head;\n    while (current) {\n        result.push(current.val);\n        current = current.next;\n    }\n    console.log('LinkedList:', result.join(' -> '));\n}\n\n\u002F\u002F 方法一：迭代反转（推荐，空间复杂度 O(1)）\nfunction reverseListIterative(head) {\n    let prev = null;         \u002F\u002F 前驱指针\n    let current = head;      \u002F\u002F 当前指针\n    let next = null;         \u002F\u002F 临时存储下一节点\n\n    while (current !== null) {\n        next = current.next; \u002F\u002F 保存下一节点\n        current.next = prev; \u002F\u002F 反转指针\n        prev = current;      \u002F\u002F 前驱前进\n        current = next;      \u002F\u002F 当前前进\n    }\n    return prev;  \u002F\u002F prev 成为新头节点\n}\n\n\u002F\u002F 方法二：递归反转\nfunction reverseListRecursive(head) {\n    \u002F\u002F 递归终止条件：空链表或只有一个节点\n    if (head === null || head.next === null) {\n        return head;\n    }\n\n    \u002F\u002F 递归反转后续链表\n    const newHead = reverseListRecursive(head.next);\n\n    \u002F\u002F 反转当前节点与下一节点的指向\n    head.next.next = head;\n    head.next = null;\n\n    return newHead;  \u002F\u002F 新头节点始终是原链表的尾节点\n}\n\n\u002F\u002F 使用示例\nconst list = createLinkedList([1, 2, 3, 4, 5]);\nprintLinkedList(list);  \u002F\u002F 1 -> 2 -> 3 -> 4 -> 5\n\nconst reversedIterative = reverseListIterative(list);\nprintLinkedList(reversedIterative);  \u002F\u002F 5 -> 4 -> 3 -> 2 -> 1\n\nconst list2 = createLinkedList([6, 7, 8]);\nprintLinkedList(list2);  \u002F\u002F 6 -> 7 -> 8\n\nconst reversedRecursive = reverseListRecursive(list2);\nprintLinkedList(reversedRecursive);  \u002F\u002F 8 -> 7 -> 6\n",[1113,1198,1196],{"__ignoreMap":1111},[1159,1200,1172],{"id":1201},"ts实现-1",[1106,1203,1208],{"className":1204,"code":1206,"language":1207,"meta":1111},[1205],"language-ts","\u002F\u002F 单向链表节点类型\nclass ListNode {\n  val: number\n  next: ListNode | null\n  constructor(val?: number, next?: ListNode) {\n    this.val = val ?? 0\n    this.next = next ?? null\n  }\n}\n\n\u002F\u002F 创建链表辅助函数\nfunction createLinkedList(arr: number[]): ListNode | null {\n  if (arr.length === 0) return null\n  const head = new ListNode(arr[0])\n  let current = head\n  for (let i = 1; i \u003C arr.length; i++) {\n    current.next = new ListNode(arr[i])\n    current = current.next\n  }\n  return head\n}\n\n\u002F\u002F 打印链表辅助函数\nfunction printLinkedList(head: ListNode | null): void {\n  const result: number[] = []\n  let current = head\n  while (current) {\n    result.push(current.val)\n    current = current.next\n  }\n  console.log('LinkedList:', result.join(' -> '))\n}\n\n\u002F\u002F 迭代反转（推荐，空间 O(1)）\nfunction reverseListIterative(head: ListNode | null): ListNode | null {\n  let prev: ListNode | null = null\n  let current: ListNode | null = head\n\n  while (current !== null) {\n    const next = current.next \u002F\u002F 保存下一节点\n    current.next = prev \u002F\u002F 反转指针\n    prev = current \u002F\u002F 前驱前进\n    current = next \u002F\u002F 当前前进\n  }\n  return prev \u002F\u002F 新头节点\n}\n\n\u002F\u002F 递归反转\nfunction reverseListRecursive(head: ListNode | null): ListNode | null {\n  if (head === null || head.next === null) {\n    return head\n  }\n  const newHead = reverseListRecursive(head.next)\n  head.next.next = head\n  head.next = null\n  return newHead\n}\n\n\u002F\u002F 使用示例\nconst list = createLinkedList([1, 2, 3, 4, 5])\nprintLinkedList(list) \u002F\u002F 1 -> 2 -> 3 -> 4 -> 5\n\nconst reversedIter = reverseListIterative(list)\nprintLinkedList(reversedIter) \u002F\u002F 5 -> 4 -> 3 -> 2 -> 1\n\nconst list2 = createLinkedList([6, 7, 8])\nconst reversedRec = reverseListRecursive(list2)\nprintLinkedList(reversedRec) \u002F\u002F 8 -> 7 -> 6\n","ts",[1113,1209,1206],{"__ignoreMap":1111},[1091,1211,1212],{},"DFA:",[1214,1215,1216,1222],"ul",{},[1217,1218,1219,1221],"li",{},[1150,1220,188],{},"：适合随机访问（O(1)），插入\u002F删除较慢（O(n)），实现简单，内存连续",[1217,1223,1224,1226],{},[1150,1225,178],{},"：适合频繁插入\u002F删除（O(1)），随机访问慢（O(n)），内存分散，支持动态扩展, 链表常用于特定算法（如 LRU 缓存、链表反转等）",{"title":1111,"searchDepth":1228,"depth":1228,"links":1229},4,[1230,1232,1233,1238],{"id":1100,"depth":1231,"text":1101},2,{"id":1126,"depth":1231,"text":1127},{"id":1144,"depth":1231,"text":1145,"children":1234},[1235,1237],{"id":1161,"depth":1236,"text":1162},3,{"id":1171,"depth":1236,"text":1172},{"id":1185,"depth":1231,"text":1185,"children":1239},[1240,1241],{"id":1191,"depth":1236,"text":1192},{"id":1201,"depth":1236,"text":1172},"md",true,{"uuid":1245,"slots":1246},"9d053150-e211-11f0-b4dd-8b5a45240b4b",{},1,{"title":1085,"description":1093},"posts\u002F2025\u002F2025-12-26-Javascript，TypeScript 的顺序表，链表实现",[42,188,178,189],"6dKR12_OmophKQy7Itocxb401hYUnGOLVrjDNFi1M6k",1790443287203]