leetcode题目总结

双指针

15.三个数之和  https://leetcode-cn.com/problems/3sum/

19.删除链表的倒数第N个结点 (快慢指针 同时用pre来存储删除节点的前继节点 在原链表头加一个头节点解决删除头节点的问题)https://leetcode-cn.com/problems/remove-nth-node-from-end-of-list/

21.合并两个有序链表 https://leetcode-cn.com/problems/merge-two-sorted-lists/

101.对称二叉树 (采用两个指针,一个往左移,一个往右移)https://leetcode-cn.com/problems/symmetric-tree/

141.环形链表(快慢指针,注意判断next是否为空) https://leetcode-cn.com/problems/linked-list-cycle/

160.相交链表(消除两个链表的长度差)https://leetcode-cn.com/problems/intersection-of-two-linked-lists/

   (很好的解析)https://leetcode-cn.com/problems/intersection-of-two-linked-lists/solution/intersection-of-two-linked-lists-shuang-zhi-zhen-l/

206.反转链表 https://leetcode-cn.com/problems/reverse-linked-list/

234.回文链表(找到中间然后翻转后面) https://leetcode-cn.com/problems/palindrome-linked-list/

283.移动零 https://leetcode-cn.com/problems/move-zeroes/

回溯

46.全排列(注意用标记数组 遍历完这种情况复原)https://leetcode-cn.com/problems/permutations/

17.电话号码的字母组合(递归的思想 排列组合)https://leetcode-cn.com/problems/letter-combinations-of-a-phone-number/

18.组合总和(排列组合,组合中的元素可以重复使用,这个时候考虑不选和继续选两种情况)https://leetcode-cn.com/problems/combination-sum/

22.括号生成 https://leetcode-cn.com/problems/generate-parentheses/

二分查找(用在有序的查找)

33.搜索旋转排序数组(注意二分后哪一段有序问题) https://leetcode-cn.com/problems/search-in-rotated-sorted-array/

34.在排序数组中查找元素的第一个和最后一个元素 https://leetcode-cn.com/problems/find-first-and-last-position-of-element-in-sorted-array/

动态规划

53.最大子序和 https://leetcode-cn.com/problems/maximum-subarray/submissions/

55.跳跃游戏 https://leetcode-cn.com/problems/jump-game/

70.爬楼梯 https://leetcode-cn.com/problems/climbing-stairs/

5.最长回文子串 https://leetcode-cn.com/problems/longest-palindromic-substring/

20.有效的括号 https://leetcode-cn.com/problems/valid-parentheses/

155.最小栈(用一个辅助栈来存储最小值) https://blog.csdn.net/devnn/article/details/82716447

二叉树

101.对称二叉树 https://leetcode-cn.com/problems/symmetric-tree/

104.二叉树的最大深度 https://leetcode-cn.com/problems/maximum-depth-of-binary-tree/

226.翻转二叉树 https://leetcode-cn.com/problems/invert-binary-tree/

543.二叉树的直径(左边高度+右边高度,或者子树的最大半径)https://leetcode-cn.com/problems/diameter-of-binary-tree/

617.合并二叉树 https://leetcode-cn.com/problems/merge-two-binary-trees/

位运算

136.只出现一次的数字(异或) https://leetcode-cn.com/problems/single-number/

461.汉明距离(异或)https://leetcode-cn.com/problems/hamming-distance/

摩尔投票法(抵消)

169.多数元素(每个“多数元素”和其他元素 两两相互抵消,抵消到最后肯定还剩余至少1个“多数元素”) https://leetcode-cn.com/problems/majority-element/

讲解 https://leetcode-cn.com/problems/majority-element-ii/solution/liang-fu-dong-hua-yan-shi-mo-er-tou-piao-fa-zui-zh/

数组

448.找到所有数组中消失的数字(用下标来标记,出现了的数字1,则nums[0或者1]为负数) https://leetcode-cn.com/problems/find-all-numbers-disappeared-in-an-array/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值