摘要: 单个队列模拟栈,要么在offer元素A的时候,将A直接排列在队列的队首,要么在调用的时候排列。关于添加和删除操作,Stack和Queue方法的选词还是非常有特点 阅读全文
posted @ 2024-08-10 16:15 ZeroPhix 阅读(14) 评论(0) 推荐(0)
摘要: 用双栈实现队列,本质上使用了两次镜像反射。双栈设计,缓存思想、同步异步操作的思想, 阅读全文
posted @ 2024-08-10 11:22 ZeroPhix 阅读(18) 评论(0) 推荐(0)
摘要: 游标步长与循环不变量概念 阅读全文
posted @ 2024-08-09 18:51 ZeroPhix 阅读(15) 评论(0) 推荐(0)
摘要: 字符数组本质上还是数组,在数组上使用的方法技巧在字符数组上同样适用 阅读全文
posted @ 2024-08-09 17:46 ZeroPhix 阅读(17) 评论(0) 推荐(0)
摘要: 与Valid-Anagram类似 阅读全文
posted @ 2024-08-09 17:08 ZeroPhix 阅读(15) 评论(0) 推荐(0)
摘要: 大问题拆分为子问题,使用了对称的思想,再利用边界条件,降低自由变量的个数,与Two Sum完全可以类比 阅读全文
posted @ 2024-08-09 16:56 ZeroPhix 阅读(22) 评论(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 阅读(19) 评论(0) 推荐(0)
摘要: 快乐数的检测过程实际上是一个寻找循环的过程,无论是1自身的循环,还是在有限空间内的循环 阅读全文
posted @ 2024-08-09 13:24 ZeroPhix 阅读(42) 评论(0) 推荐(0)
摘要: 双指针方式,本质是遍历,遍历过程将问题一分为二,拆分为已解决和未解决的问题 阅读全文
posted @ 2024-08-09 11:33 ZeroPhix 阅读(21) 评论(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 阅读(15) 评论(0) 推荐(0)