LeetCode算法题

算法题

1.剑指offer 68题:https://www.nowcoder.com/discuss/198840source_id=profile_create_nctrack&channel=-1
2.leetcode top100:https://blog.csdn.net/weixin_38896998/article/details/88810177 题目链接:https://blog.csdn.net/lingpy/article/details/88085446 算法与思路:https://blog.csdn.net/yuzhengfei7/article/details/82227476
3.华为机试:https://www.nowcoder.com/exam/oj/ta?page=1&tpId=37&type=37

1.kmp算法&字符串

1.字符串搜素:https://www.cnblogs.com/yjiyjige/p/3263858.html
2.替换空格(双指针,JZ第5题):https://blog.csdn.net/u013132035/article/details/80518640
3.打印从1到最大的n位数(字符串解决大数问题):https://blog.csdn.net/pcwl1206/article/details/85834735
4.表示数值的字符串(正则表达式):https://www.cnblogs.com/wupeixuan/p/8743056.html
5.字符流中第一个不重复的字符(char+队列 or HashMap+ArrayList):https://blog.csdn.net/qq_44807642/article/details/103206637?spm=1001.2014.3001.5502
6.最长的不含重复字符的子字符串(hashMap+滑动窗口):https://blog.csdn.net/qq_40915439/article/details/107931733
7.字符串中第一个只出现一次的字符位置(整型数组代替hashMap):https://blog.csdn.net/u014259820/article/details/88698551
8.翻转单词顺序列(先翻转单词,再反转整个句子):https://www.cnblogs.com/strive-19970713/p/11177373.html
  8.1 左旋转字符串(先分别翻转,在整体翻转):
9.Z字形变换:https://leetcode-cn.com/submissions/detail/252809123/
10.把字符串转换成整数:https://www.cnblogs.com/MoonBeautiful/p/11477050.html
11.全排列(第46题):https://blog.csdn.net/weixin_38896998/article/details/88810177
  11.1.全排列2(第47题):https://leetcode-cn.com/problems/permutations-ii/comments/
  11.2.字符串的排列(JZ第38题):https://www.nowcoder.com/discuss/198840?source_id=profile_create_nctrack&channel=-1
相似题:子集(动态规划10),组合总和(数组与矩阵19)
12.最小覆盖子串(算双指针):https://blog.csdn.net/weixin_40928253/article/details/92390999
  12.1找到字符串中所有字母异位词(双指针滑动窗口,第438题):https://blog.csdn.net/weixin_38896998/article/details/88810177
13.字符串解码(递归,数字栈和字符栈,第394题):https://blog.csdn.net/qq_38905818/article/details/104402567https://blog.csdn.net/weixin_38896998/article/details/88810177
14.宝石与石头(hashmap,第771题):https://blog.csdn.net/weixin_38896998/article/details/88810177
15.回文子串(中心扩展法,第647题):https://blog.csdn.net/weixin_38896998/article/details/88810177
  15.1最长回文子串(中心扩展法第5题):https://blog.csdn.net/weixin_38896998/article/details/88810177

2.动态规划

1.打家劫舍:https://blog.csdn.net/weixin_45003125/article/details/119335848
2.背包问题:https://www.cnblogs.com/mfrank/p/10849505.html
3.斐波那契数列(递归/双指针,JZ第10.1题):https://www.nowcoder.com/discuss/198840?source_id=profile_create_nctrack&channel=-1
  3.1矩形覆盖(JZ第10.2题):
  3.2跳台阶(爬楼梯,第70题):
  3.3变态跳台阶(f(n)=2f(n-1),JZ第10.4题):
4.预测赢家(递归/动态规划,第486题):https://www.freesion.com/article/6824975989/
5.剪绳子(递归(自顶向下)/动态规划/贪心):https://www.cnblogs.com/treasury/p/12618112.html
6.把数字翻译成字符串(动态规划):https://www.cnblogs.com/heaveneleven/p/12841191.html
7.礼物的最大价值(动态规划):https://www.jianshu.com/p/5d6d69f12722
  7.1 不同路径(动态规划,第62题):https://blog.csdn.net/weixin_38896998/article/details/88810177
  7.2 不同路径||(动态规划,第63题):https://blog.csdn.net/u014472643/article/details/81185246
  7.3 最小路径和(动态规划,第64题):https://blog.csdn.net/weixin_38896998/article/details/88810177
8.最长升序子序列(动态规划,优化O(nlogn),第300题):https://www.jianshu.com/p/6fc5f3c04968
9.编辑距离(动态规划,第72题):https://blog.csdn.net/weixin_38896998/article/details/88810177
https://www.cnblogs.com/sjjghsf/p/13494232.html
10.子集(递归,第78题):https://blog.csdn.net/weixin_38896998/article/details/88810177
11.单词拆分(动态规划,第139题):https://blog.csdn.net/weixin_38896998/article/details/88810177
12.最大正方形(动态规划):https://blog.csdn.net/yunfengfengfeng/article/details/106008599
13.完全平方数(动态规划,第279题):https://blog.csdn.net/weixin_38896998/article/details/88810177
14.戳气球(动态规划,第312题):https://blog.csdn.net/weixin_38896998/article/details/88810177
15.零钱兑换(动态归还,第322题):https://blog.csdn.net/weixin_38896998/article/details/88810177
16.比特位计数(动态规划,第338题):https://blog.csdn.net/weixin_38896998/article/details/88810177
17.分割等和子集(动态规划,背包问题,第416题):https://www.cnblogs.com/xym4869/p/13023993.html
18.接雨水(动态规划,优化双指针,第42题):https://www.cnblogs.com/ccstrong/p/12639201.html
19.解码方法(动态规划,第91题):https://www.cnblogs.com/flix/p/13279681.html

3.贪心算法

1.DOTA2参议院:https://blog.csdn.net/Strive_LiJiaLe/article/details/116278407
2.最长连续递增序列:https://blog.csdn.net/qq_16151925/article/details/80204845
3.柠檬水找零(第860题):https://www.136.la/nginx/show-82971.html
4.三角形的最大周长(先排序再找,第976题):https://blog.csdn.net/qq_36214481/article/details/86503896
5.买卖股票的最佳时机I(第121题):https://blog.csdn.net/Sruggle/article/details/111032853
  5.1买卖股票的最佳时机II(第122题):https://blog.csdn.net/qq_17550379/article/details/83444673
  5.2买卖股票的最佳时机III(第123题):https://blog.csdn.net/qq_17550379/article/details/83620892
  5.3买卖股票的最佳时机IIII(第123题):https://www.cnblogs.com/lillcol/p/14218940.html
  5.4最佳买卖股票的时机含冷冻期(动态规划,第309题):https://blog.csdn.net/qq_17550379/article/details/82856452
  5.5最佳买卖股票的时机含手续费(动态规划,第714题):https://www.cnblogs.com/lillcol/p/14218940.html
6.乘积最大子序列(遇到负数交换最大最小值,LeetCode第152题):https://blog.csdn.net/weixin_38896998/article/details/88810177

4.数组与矩阵

1.寻找中心下标:https://blog.csdn.net/weixin_53156322/article/details/120373579
2.合并两个有序数组:https://www.cnblogs.com/zhlz/p/10495860.html
3.子数组最大平均数:https://blog.csdn.net/u010690493/article/details/88395403
4.数组中重复的数字(调整数字位置):https://www.cnblogs.com/zxzhou/p/11690440.html
  4.1.寻找重复数(不可改变数组)(二分法,快慢指针找环的入口,第287题,链表第7.5题):https://blog.csdn.net/tc_1337/article/details/88138604
5.二维数组中的查找(LeetCode第240题):https://blog.csdn.net/weixin_38896998/article/details/88810177
6.旋转数组的最小数字(二分查找):https://blog.csdn.net/u013132035/article/details/80545694
7.矩阵中的路径(递归回溯法):https://blog.csdn.net/qq_40742428/article/details/98883933
  7.1单词搜索(LeetCode第79题):https://blog.csdn.net/weixin_38896998/article/details/88810177
8.机器人的运动范围(递归):https://blog.csdn.net/happyjacob/article/details/86772110
9.调整数组顺序使奇数位于偶数前面:https://blog.csdn.net/pcwl1206/article/details/85916375
10.顺时针打印矩阵(JZ第29题):https://www.nowcoder.com/discuss/198840?source_id=profile_create_nctrack&channel=-1
11.连续子数组的最大和(贪心算法):https://blog.csdn.net/m0_37925202/article/details/80816684
12.把数组排成最小的数(先排序再拼接,JZ第45题):https://blog.csdn.net/weixin_48440312/article/details/110119835
13.数组中的逆序对(归并排序):
14.数组中出现次数超过一半的数字(LeetCode第169题):https://blog.csdn.net/u013019701/article/details/80978224
15.数组中只出现一次的两个数字(异或位运算/hashMap):https://blog.csdn.net/hyqsong/article/details/49445089
16.滑动窗口的最大值(双端队列):https://www.cnblogs.com/gzshan/p/10904273.html
17.寻找两个正序数组的中位数(二分法):https://www.cnblogs.com/flightless/p/13708074.html
18.盛最多水的容器(双指针):https://zhuanlan.zhihu.com/p/40616691
19.组合总和(第39题):https://blog.csdn.net/weixin_38896998/article/details/88810177
20.除自身以外数组的乘积(不能使用除法,第238题):https://blog.csdn.net/weixin_38896998/article/details/88810177
21.找到所有数组中消失的数字(第448题):https://blog.csdn.net/weixin_38896998/article/details/88810177
22.目标和(递归,第494题):https://blog.csdn.net/weixin_38896998/article/details/88810177
23.和为k的子数组(第560题):https://www.cnblogs.com/flix/p/12897692.htmlhttps://blog.csdn.net/qq_23594799/article/details/106005787
24.最大矩形(动态规划,栈,第85题,困难):https://blog.csdn.net/weixin_42970433/article/details/111083590
25.岛屿的个数(dfs,第200题):https://www.jianshu.com/p/d5eb363b01d5
26.子数组的范围和(第2104题):https://blog.csdn.net/qq_27060423/article/details/121889999

5.算术数学

1.求x的平方根(二分法/牛顿迭代):https://blog.csdn.net/qq_41231926/article/details/82861877
2.统计素数个数:
3.三个数的最大乘积(排序/线性扫描):https://blog.csdn.net/GLOAL_COOK/article/details/119799054
4.两数之和(HashMap):https://www.cnblogs.com/fm98/p/11518008.html
  4.1 和为S的两个数(双指针):
  4.2 和为S的连续正数序列:https://blog.csdn.net/zangdaiyang1991/article/details/90523958
  4.3 两数相加:https://blog.csdn.net/zhizhengguan/article/details/106135859
  4.4 三数相加为零(先排序,再遍历):https://blog.csdn.net/MoForest/article/details/84556709
5.排列硬币(二分/牛顿迭代):https://www.cnblogs.com/bc-song/p/15389252.html
6.数值的整数次方(递归):https://blog.csdn.net/qq_39397165/article/details/103964636
7.从1到n的整数中1的个数:https://blog.csdn.net/u013560925/article/details/83410923https://www.cnblogs.com/xuanxufeng/p/6854105.html
8.数字序列中的某一位数字:https://www.cnblogs.com/wangkundentisy/p/8963605.html
9.求1+2+3+……+n(&&+递归):https://blog.csdn.net/weixin_42805929/article/details/83904114
10.不用加减乘除做加法:https://www.cnblogs.com/yongh/p/9971383.html
11.移动零(简单题,第283题):https://blog.csdn.net/weixin_38896998/article/details/88810177

6.链表

1.链表反转:https://www.jb51.net/article/219870.htm
2.判断链表是否有环(快慢双指针):https://www.cnblogs.com/yorkyang/p/10876604.html
3.从尾到头打印链表(递归/反转链表/栈):https://blog.csdn.net/u013132035/article/details/80520245
4.删除链表中重复的结点(JZ第18.2题):https://www.nowcoder.com/discuss/198840?source_id=profile_create_nctrack&channel=-1
5.在O(1)时间内删除链表节点(JZ第18.1题):https://www.nowcoder.com/discuss/198840?source_id=profile_create_nctrack&channel=-1
6.链表中倒数第k个结点(双指针,第22题):https://www.nowcoder.com/discuss/198840?source_id=profile_create_nctrack&channel=-1
7.链表中环的入口(快慢指针):https://www.cnblogs.com/yorkyang/p/10876604.html
  7.1判断链表是否有环(LeetCode第141题):
  7.1链表中环的结点个数(快慢指针):
  7.2有环链表的长度:
  7.3求环上距离任意一点最远的点(对面结点,快慢指针):
  7.4判断两个无环链表是否相交(转化为有环链表解答):
  7.5寻找重复数(二分法,快慢指针找环的入口,第287题,数组第4.1题):https://blog.csdn.net/weixin_38896998/article/details/88810177
8.合并两个排序的链表(递归/迭代):
9.复杂链表的复制(插入,建立连接,拆分):
10.二叉搜索树与双向链表(中序遍历):https://www.cnblogs.com/dazhu123/p/12552985.html
11.合并K个升序链表(迭代/最小堆):https://blog.csdn.net/ibianma/article/details/108060053
12.排序链表(归并排序,第148题):https://blog.csdn.net/weixin_38896998/article/details/88810177
13.回文链表(第234题):https://blog.csdn.net/weixin_38896998/article/details/88810177

7.栈队列堆

1.用两个栈实现队列:
2.包含min函数的栈:
3.栈的压入、弹出序列:
4.有效的括号(栈):https://blog.csdn.net/qq_41175905/article/details/109536135
  4.1 生成括号(递归,动态规划,第22题):https://blog.csdn.net/weixin_38896998/article/details/88810177https://blog.csdn.net/weixin_43857345/article/details/106946216
  4.1 最长有效括号(栈,第32题):https://blog.csdn.net/weixin_38896998/article/details/88810177
5.最小栈(两个栈,第155题):https://blog.csdn.net/weixin_38896998/article/details/88810177
6.最长连续序列(hashmap,第128题):

8.双指针

1.删除排序数组中的重复数:
2.有序数组的两数之和:
3.

9.树

1.二叉树遍历(前中后序/递归/迭代/Morris):
  1.1二叉树的中序遍历(栈,第94题):https://blog.csdn.net/weixin_38896998/article/details/88810177
  1.2验证二叉搜索树(中序遍历,第98题):https://blog.csdn.net/weixin_38896998/article/details/88810177
2.重建二叉树(递归,JZ第7题):https://www.nowcoder.com/discuss/198840source_id=profile_create_nctrack&channel=-1
3.二叉树的下一个结点(情况分析):
4.二叉搜索树的第k个节点(递归/栈):
5.二叉树中和为某一值的路径(深度优先DFS,递减,JZ第34题):与数组第19题组合总和很像https://www.nowcoder.com/practice/b736e784e3e34731af99065031301bca
  5.1路径总和I(第112题):https://cloud.tencent.com/developer/article/1663680
  5.2路径总和II(第113题):https://cloud.tencent.com/developer/article/1663680
  5.3路径总和III(第437题):https://blog.csdn.net/weixin_40314385/article/details/98076911
6.树的子结构(递归,第572题):https://www.cnblogs.com/lishanlei/p/10707732.html
7.二叉树的镜像(递归):
8.对称的二叉树(递归/栈,第101题):https://blog.csdn.net/gaoyueace/article/details/89556207
9.从上往下打印二叉树(队列,第102题):https://blog.csdn.net/weixin_38896998/article/details/88810177
  9.1.将二叉树打印成多行(队列+一行数据一个ArrayList):
  9.2.按之字形打印二叉树(队列+一个判断是否反转ArrayList):
10.二叉搜索树的后序遍历序列(递归):
11.序列化二叉树:https://www.cnblogs.com/gzshan/p/10898708.html
12.二叉树的深度(第104题):https://blog.csdn.net/weixin_38896998/article/details/88810177
13.平衡二叉树:
14.树中两个节点最低公共祖先(第236题):https://blog.csdn.net/weixin_38896998/article/details/88810177
15.不同的二叉搜索树(动态规划):https://blog.csdn.net/weixin_40673608/article/details/86533230
  15.1不同的二叉搜索树 II(递归):https://www.cnblogs.com/powercai/p/11052667.html
16.根节点到子节点所有路径和(递归):https://www.cnblogs.com/zccfrancis/p/14504803.html
  16.1二叉树中的最大路径和(递归,第124题):https://blog.csdn.net/weixin_38896998/article/details/88810177
17.翻转二叉树(递归,第226题):https://blog.csdn.net/weixin_38896998/article/details/88810177
18.把二叉搜索树转化为累加树(反向中序遍历,递归/栈,第538题):https://www.cnblogs.com/tqlin/p/11565256.html
19.二叉树的直径(第543题):https://blog.csdn.net/weixin_38896998/article/details/88810177
20.合并二叉树(第617题):https://blog.csdn.net/weixin_38896998/article/details/88810177
21.二叉搜索树与双向链表(链表第10题):
  21.1二叉树展开为链表(递归,第114题):https://blog.csdn.net/weixin_38896998/article/details/88810177

10.图

1.省份数量(深度优先/广度优先/并查集):
2.修路问题(普利姆算法):

11.二分查找

12.分治

13.搜索

14.排序

1.最小的k个数(topk,快排,堆排序):https://blog.csdn.net/ouyangyanlan/article/details/72152544
  1.1前k个高频元素(hashmap+最大堆,第347题):https://blog.csdn.net/weixin_38896998/article/details/88810177
2.数据流中的中位数(大、小顶堆):
3.下一个排列(第31题):https://blog.csdn.net/weixin_38896998/article/details/88810177
4.颜色分类(桶排序,三路快排,第75题):https://blog.csdn.net/weixin_38896998/article/details/88810177
5.根据身高重建队列(身高从高到低和从低到高,第406题):https://www.cnblogs.com/a1439775520/p/12946502.htmlhttps://blog.csdn.net/fuqiuai/article/details/83154966
6.冒泡排序及其优化:https://www.cnblogs.com/jyroy/p/11248691.html

15.位运算

1.二进制中1的个数(n&n-1):
2.汉明距离(第416题):https://blog.csdn.net/weixin_38896998/article/details/88810177

16.其它

1.香槟塔:
2.井字游戏:
3.正则表达式匹配(分情况,回溯):https://blog.csdn.net/weixin_44135282/article/details/102490604
4.约瑟夫环(链表/递归):https://blog.csdn.net/qie_wei/article/details/87915174
5.扑克牌顺子(先排序):
6.跳跃游戏(从后往前跳第55题):https://editor.csdn.net/md?articleId=121334972

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值