Eagle233-Blog
dev-mdsuper
[Algorithms] LeetCode 面试题 02.07. 链表相交
Categories Algorithms LinkedList | Tags
来源:代码随想录 LeetCode 面试题 02.07. 链表相交 求长度之差比谁长,谁长谁先走,最后一起走,走到一样的就返回。 /** * Definition for singly-l...
[Algorithms] LeetCode 19. 删除链表的倒数第 N 个结点
Categories Algorithms LinkedList | Tags
来源:代码随想录 LeetCode 19. 删除链表的倒数第 N 个结点 双指针虚拟头节点很管用,经常能够应付莫名其妙的空指针问题。其实也不是莫名其妙,只是能给自己少找点麻烦。就像高中的时候...
[Algorithms] LeetCode 24. 两两交换链表中的节点
Categories Algorithms LinkedList | Tags
来源:代码随想录 LeetCode 24. 两两交换链表中的节点 三指针三指针,其中当前指针只要定义一个,其他两个在while循环里面定义就好,这样在判断时只有一个变量,也只要改变一次cur...
[Algorithms] 待复习
Categories Algorithms | Tags
20250407// 20250414 !// 20250421LeetCode 977. 有序数组的平方 // 20250414 !...
[Algorithms] LeetCode 206. 反转链表
Categories Algorithms LinkedList | Tags
来源:代码随想录 LeetCode 206. 反转链表 双指针这题又忘记怎么做了。只需要cur pre两个指针,一开始各自指向head nullptr. /** * Definition ...
[Algorithms] LeetCode 707. 设计链表
Categories Algorithms LinkedList | Tags
来源:代码随想录 LeetCode 707. 设计链表 单链表链表问题不大,cpp语法问题很大,构造函数都不会写。MyLinkedList是构造函数,变量不用类型是因为在私有里面已经声明过了...
[Algorithms] LeetCode 203. 移除链表元素
Categories Algorithms LinkedList | Tags
来源:代码随想录 LeetCode 203. 移除链表元素 虚拟头节点 Dummy Head这题没一遍过,因为并不是每次循环都要把指针指向下一个节点,如果进行了删除操作,那么下一个节点还需要...
[Algorithms] KamaCoder 44. 开发商购买土地(第五期模拟笔试)
Categories Algorithms Array | Tags
来源:代码随想录 KamaCoder 44. 开发商购买土地(第五期模拟笔试) 前缀和Plus。有两种划分,那么分别开两个数组,把二维数组从行列两个方向压缩成列行和,然后再用前缀和。观察到求...
[Algorithms] KamaCoder 58. 区间和(第九期模拟笔试)
Categories Algorithms Array | Tags
来源:代码随想录 KamaCoder 58. 区间和(第九期模拟笔试) 前缀和的思想。 #include <bits/stdc++.h> using namespace std; ...
[Algorithms] LeetCode 59. 螺旋矩阵 II
Categories Algorithms Array | Tags
来源:代码随想录 LeetCode 59. 螺旋矩阵 II 考察基本功啊,区间统一左闭右开,最后记得处理n为奇数的情况。 class Solution { public: ...
© 2025 Eagle233
Powered By Hexo & Theme mdsuper