摘要: 与Valid-Anagram类似 阅读全文
posted @ 2024-08-09 17:08 ZeroPhix 阅读(29) 评论(0) 推荐(0)
摘要: 大问题拆分为子问题,使用了对称的思想,再利用边界条件,降低自由变量的个数,与Two Sum完全可以类比 阅读全文
posted @ 2024-08-09 16:56 ZeroPhix 阅读(33) 评论(0) 推荐(0)
摘要: 分析 Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You may assume that each 阅读全文
posted @ 2024-08-09 15:29 ZeroPhix 阅读(32) 评论(0) 推荐(0)
摘要: 快乐数的检测过程实际上是一个寻找循环的过程,无论是1自身的循环,还是在有限空间内的循环 阅读全文
posted @ 2024-08-09 13:24 ZeroPhix 阅读(63) 评论(0) 推荐(0)
摘要: 双指针方式,本质是遍历,遍历过程将问题一分为二,拆分为已解决和未解决的问题 阅读全文
posted @ 2024-08-09 11:33 ZeroPhix 阅读(30) 评论(0) 推荐(0)
摘要: Valid-Anagram:a word or phrase that is made by changing the order of the letters in another word or phrase 阅读全文
posted @ 2024-08-05 13:50 ZeroPhix 阅读(26) 评论(0) 推荐(0)
摘要: 环形链表与链表相交可以结合起来思考,环形链表的环入口可以看做是特殊形式的中间结点, 也可利用地址唯一性引入哈希法 阅读全文
posted @ 2024-08-04 16:27 ZeroPhix 阅读(36) 评论(0) 推荐(0)
摘要: 相交链表转换成相遇问题,当两者不相交解决无限循环的问题,就在于双指针全部遍历后,又重新从对方的链表开始无限循环遍历 阅读全文
posted @ 2024-08-03 20:25 ZeroPhix 阅读(35) 评论(0) 推荐(0)
摘要: 如何理解链表增加结点中的n的位置?是之前还是之后?虚拟头结点的作用是什么?断开链表需要注意的的点 阅读全文
posted @ 2024-08-03 14:52 ZeroPhix 阅读(90) 评论(0) 推荐(0)
摘要: 数组本身的递归性,差分数组的不变性和可逆性,在left索引上对当前及后续所有元素产生影响,在right+1索引上进行反操作,消除这种影响,再进行还原 阅读全文
posted @ 2024-08-02 23:49 ZeroPhix 阅读(55) 评论(0) 推荐(0)