目前许多文章还在CSDN捏(左下角有音乐哦)
03 2024 档案
摘要:
https://leetcode.cn/problems/game-of-life/?envType=study-plan-v2&envId=2024-spring-sprint-100 先创建一个数组,让它比原数组大一圈,然后将其全设为0,在原数组中每有一个1出现,就将其对应位置的新数组的周围全部
阅读全文

摘要:
https://leetcode.cn/problems/spiral-matrix/description/?envType=study-plan-v2&envId=2024-spring-sprint-100 注意每次改变边界都有判断一次 class Solution { public: vec
阅读全文

摘要:
1、https://leetcode.cn/problems/reverse-words-in-a-string/description/?envType=study-plan-v2&envId=top-interview-150 class Solution { public: string re
阅读全文

摘要:
1、https://leetcode.cn/problems/length-of-last-word/description/?envType=study-plan-v2&envId=top-interview-150 直接从后往前遍历就好 class Solution { public: int
阅读全文

摘要:1、https://leetcode.cn/problems/roman-to-integer/solutions/1/bao-li-po-jie-by-a-studentdog-s1va/?envType=study-plan-v2&envId=top-interview-150 关键在于创建字典
阅读全文
摘要:https://leetcode.cn/problems/trapping-rain-water/description/?envType=study-plan-v2&envId=top-interview-150 对于一个可以构成“碗”的序列,最后装满水的话应该和最短的一边齐平,那么可以左右各遍历
阅读全文
摘要:1、https://leetcode.cn/problems/gas-station/submissions/514930619/?envType=study-plan-v2&envId=top-interview-150 对于这个问题可以这样来考虑,将数据看作一个环,如果答案唯一,那么就意味着从任
阅读全文
摘要:
https://leetcode.cn/problems/product-of-array-except-self/description/?envType=study-plan-v2&envId=top-interview-150 问题在于不使用除法并且空间复杂度为O(1),当第一次从头开始遍历时
阅读全文

摘要:
https://leetcode.cn/problems/h-index/description/?envType=study-plan-v2&envId=top-interview-150 注:题目有点难理解,多读几遍 可以这样考虑,建立另一个临时数组temp,当第i篇文章被引用citiation
阅读全文

摘要:
线索二叉树即从前、中、后序三种遍历中其中一种来看,树中的左右孩子都不会是空着的,都会指向对应的前驱和后驱。 以中序遍历为例,二叉树线索化过程如下: 先是树的结构 typedef struct ThreadNode{ Elemetype data; struct ThreadNode *lchild,
阅读全文
