Skip to content

g908682550/Algorithm-Demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Leetcode

1:两数之和 https://github.com/g908682550/Demo/blob/master/src/leetcode/TwoSum1.java

2:两数相加 https://github.com/g908682550/Demo/blob/master/src/leetcode/AddTwoNumbers2.java

3:无重复字符的最长子串 https://github.com/g908682550/Demo/blob/master/src/leetcode/LengthOfLongestSubstring3.java

4:寻找两个正序数组的中位数 https://github.com/g908682550/Demo/blob/master/src/leetcode/FindMedianSortedArrays4.java

5:最长回文子串 https://github.com/g908682550/Demo/blob/master/src/leetcode/LongestPalindrome5.java

10:正则表达式匹配 https://github.com/g908682550/Demo/blob/master/src/leetcode/IsMatch10.java

11:盛水最多的容器 https://github.com/g908682550/Demo/blob/master/src/leetcode/MaxArea11.java

15:三数之和 https://github.com/g908682550/Demo/blob/master/src/leetcode/ThreeSum15.java

16:最接近的三数之和 https://github.com/g908682550/Demo/blob/master/src/leetcode/ThreeSumClosest16.java

17:电话号码的字母组合 https://github.com/g908682550/Demo/blob/master/src/leetcode/LetterCombinations17.java

19:删除链表的倒数第N个节点 https://github.com/g908682550/Demo/blob/master/src/leetcode/RemoveNthFromEnd19.java

20:有效的括号 https://github.com/g908682550/Demo/blob/master/src/leetcode/RemoveNthFromEnd19.java/IsValid20.java

21:合并两个有序链表 https://github.com/g908682550/Demo/blob/master/src/leetcode/MergeTwoLists21.java

24:两两交换链表中的节点 https://github.com/g908682550/Demo/blob/master/src/leetcode/SwapPairs24.java

25:K个一组翻转链表 https://github.com/g908682550/Demo/blob/master/src/leetcode/ReverseKGroup25.java

26:删除排序数组中的重复项 https://github.com/g908682550/Demo/blob/master/src/leetcode/RemoveDuplicates26.java

27:移除元素 https://github.com/g908682550/Demo/blob/master/src/leetcode/RemoveElement27.java

30:串联所有单词的子串 https://github.com/g908682550/Demo/blob/master/src/leetcode/FindSubstring30.java

32:最长有效括号 https://github.com/g908682550/Demo/blob/master/src/leetcode/LongestValidParentheses32.java

37:解数独 https://github.com/g908682550/Demo/blob/master/src/leetcode/SolveSudoku37.java

39:组合总和 https://github.com/g908682550/Demo/blob/master/src/leetcode/CombinationSum39.java

40:组合总和II https://github.com/g908682550/Demo/blob/master/src/leetcode/CombinationSum240.java

41:缺失的第一个正数:https://github.com/g908682550/Demo/blob/master/src/leetcode/FirstMissingPositive41.java

42:接雨水 https://github.com/g908682550/Demo/blob/master/src/leetcode/Trap42.java

47:全排列II https://github.com/g908682550/Demo/blob/master/src/leetcode/PermuteUnique47.java

48:旋转矩阵 https://github.com/g908682550/Demo/blob/master/src/leetcode/Rotate48.java

49:字母异位词分组 https://github.com/g908682550/Demo/blob/master/src/leetcode/GroupAnagrams49.java

51:N皇后 https://github.com/g908682550/Demo/blob/master/src/leetcode/solveNQueens.java

60:第K个排列 https://github.com/g908682550/Demo/blob/master/src/leetcode/GetPermutation60.java

61:旋转链表 https://github.com/g908682550/Demo/blob/master/src/leetcode/RotateRight61.java

62:不同路径 https://github.com/g908682550/Demo/blob/master/src/leetcode/UniquePaths62.java

63:不同路径II https://github.com/g908682550/Demo/blob/master/src/leetcode/UniquePathwWithObstacles63.java

64:最小路径和 https://github.com/g908682550/Demo/blob/master/src/leetcode/MinPathSum64.java

70:爬楼梯 https://github.com/g908682550/Demo/blob/master/src/leetcode/ClimbStairs70.java

71:简化路径 https://github.com/g908682550/Demo/blob/master/src/leetcode/simplifyPath71.java

72:编辑距离 https://github.com/g908682550/Demo/blob/master/src/leetcode/MinDistance72.java

75:颜色分类 https://github.com/g908682550/Demo/blob/master/src/leetcode/sortColors75.java

76:最小覆盖子串 https://github.com/g908682550/Demo/blob/master/src/leetcode/MinWindow76.java

77:组合 https://github.com/g908682550/Demo/blob/master/src/leetcode/Combine77.java

78:子集 https://github.com/g908682550/Demo/blob/master/src/leetcode/Subsets78.java

79:单词搜索 https://github.com/g908682550/Demo/blob/master/src/leetcode/Exist79.java

80:删除排序数组中的重复项II https://github.com/g908682550/Demo/blob/master/src/leetcode/RemoveDuplicates80.java

82:删除排序链表的重复元素II https://github.com/g908682550/Demo/blob/master/src/leetcode/DeleteDuplicates82.java

83:删除排序链表中的重复元素 https://github.com/g908682550/Demo/blob/master/src/leetcode/DeleteDuplicates83.java

84:柱状图中最大的矩形 https://github.com/g908682550/Demo/blob/master/src/leetcode/LargestRectangleArea84.java

86:分割链表https://github.com/g908682550/Demo/blob/master/src/leetcode/Partition86.java

88:合并两个有序数组 https://github.com/g908682550/Demo/blob/master/src/leetcode/Merge88.java

90:子集II https://github.com/g908682550/Demo/blob/master/src/leetcode/SubsetsWithDup90.java

91:解码方法 https://github.com/g908682550/Demo/blob/master/src/leetcode/NumDecodings.java

92:反转链表II https://github.com/g908682550/Demo/blob/master/src/leetcode/ReverseBetween92.java

94:二叉树的中序遍历 https://github.com/g908682550/Demo/blob/master/src/leetcode/InorderTraversal94.java

98:验证二叉搜索树 https://github.com/g908682550/Demo/blob/master/src/leetcode/IsValidVBST98.java

100:相同的树 https://github.com/g908682550/Demo/blob/master/src/leetcode/IsSameTree100.java

101:对称二叉树 https://github.com/g908682550/Demo/blob/master/src/leetcode/IsSymmetric101.java

102:二叉树的层次遍历 https://github.com/g908682550/Demo/blob/master/src/leetcode/LevelOrder102.java

103:二叉树的锯齿形层次遍历 https://github.com/g908682550/Demo/blob/master/src/leetcode/ZigzagLevelOrder103.java

104:二叉树的最大深度 https://github.com/g908682550/Demo/blob/master/src/leetcode/maxDepth104.java

107:二叉树的层次遍历II https://github.com/g908682550/Demo/blob/master/src/leetcode/LevelOrderBottom107.java

110:平衡二叉树 https://github.com/g908682550/Demo/blob/master/src/leetcode/isBalanced.java

108:将有序数组转换为二叉搜索树 https://github.com/g908682550/Demo/blob/master/src/leetcode/SortedArrayToBST108.java

111:二叉树的最小深度 https://github.com/g908682550/Demo/blob/master/src/leetcode/minDepth111.java

112:路径总和 https://github.com/g908682550/Demo/blob/master/src/leetcode/HasPathSum112.java

113:路径总和II https://github.com/g908682550/Demo/blob/master/src/leetcode/pathSum.java

118:杨辉三角 https://github.com/g908682550/Demo/blob/master/src/leetcode/Generate118.java

120:三角形最小路径和 https://github.com/g908682550/Demo/blob/master/src/leetcode/MinimumTotal120.java

121:买卖股票的最佳时机 https://github.com/g908682550/Demo/blob/master/src/leetcode/MaxProfit121.java

122:买卖股票的最佳时机II https://github.com/g908682550/Demo/blob/master/src/MaxProfit122.java

122:买卖股票的最佳时机III https://github.com/g908682550/Demo/blob/master/src/MaxProfit123.java

125:验证回文串 https://github.com/g908682550/Demo/blob/master/src/leetcode/IsPalindrome125.java

127:单词接龙 https://github.com/g908682550/Demo/blob/master/src/leetcode/LadderLength127.java

129:从根到叶子节点路径之和 https://github.com/g908682550/Demo/blob/master/src/leetcode/sumNumbers129.java

130:被围绕的区域 https://github.com/g908682550/Demo/blob/master/src/leetcode/Solve130.java

131:分割回文串 https://github.com/g908682550/Demo/blob/master/src/leetcode/Partition131.java

132:分割回文串II https://github.com/g908682550/Demo/blob/master/src/leetcode/MinCut132.java

133:克隆图 https://github.com/g908682550/Demo/blob/master/src/leetcode/CloneGraph133.java

137:只出现一次的数字II https://github.com/g908682550/Demo/blob/master/src/leetcode/SingleNumber.java

138:复制带随机链表的指针 https://github.com/g908682550/Demo/blob/master/src/leetcode/CopyRandomList138.java

139:单词拆分 https://github.com/g908682550/Demo/blob/master/src/leetcode/WordBreak139.java

142:环形链表II https://github.com/g908682550/Demo/blob/master/src/leetcode/DetectCycleII142

143:重排链表 https://github.com/g908682550/Demo/blob/master/src/leetcode/ReorderList143.java

144:二叉树的前序遍历 https://github.com/g908682550/Demo/blob/master/src/leetcode/PreOrderTraversal144.java

145:二叉树的后序遍历 https://github.com/g908682550/Demo/blob/master/src/leetcode/PostOrderTraversal145

147:对链表进行插入排序 https://github.com/g908682550/Demo/blob/master/src/leetcode/InsertionSortList147.java

148:排序链表 https://github.com/g908682550/Demo/blob/master/src/leetcode/SortList148.java

149:直线上最多的点数 https://github.com/g908682550/Demo/blob/master/src/leetcode/MaxPoints149.java

150:逆波兰表达式求值 https://github.com/g908682550/Demo/blob/master/src/leetcode/RemoveNthFromEnd19.java/EvalRPN150.java

152:乘积最大子数组 https://github.com/g908682550/Demo/blob/master/src/leetcode/MaxProduct152.java

167:两数之和II-输入有序数组 https://github.com/g908682550/Demo/blob/master/src/leetcode/TwoSum167.java

169:多数元素 https://github.com/g908682550/Demo/blob/master/src/leetcode/MajorityElement169.java

198:打家劫舍 https://github.com/g908682550/Demo/blob/master/src/leetcode/Rob198.java

199:二叉树的右视图 https://github.com/g908682550/Demo/blob/master/src/leetcode/RightSideView199.java

200:岛屿数量 https://github.com/g908682550/Demo/blob/master/src/leetcode/NumsIslands200.java

202:快乐数 https://github.com/g908682550/Demo/blob/master/src/leetcode/IsHappy202.java

203:移除链表元素 https://github.com/g908682550/Demo/blob/master/src/leetcode/RemoveElements203.java

205:同构字符串 https://github.com/g908682550/Demo/blob/master/src/leetcode/IsIsomorphic205.java

206:反转链表 https://github.com/g908682550/Demo/blob/master/src/leetcode/ReverseList206.java

209:长度最小的子数组 https://github.com/g908682550/Demo/blob/master/src/leetcode/MinSubArrayLen209.java

213:打家劫舍II https://github.com/g908682550/Demo/blob/master/src/leetcode/Rob213.java

215:数组中的第K个最大元素 https://github.com/g908682550/Demo/blob/master/src/leetcode/FindKthLargest215.java

216:组合总和III https://github.com/g908682550/Demo/blob/master/src/leetcode/CombinationSum3216.java

217:存在重复元素 https://github.com/g908682550/Demo/blob/master/src/leetcode/ContainsDuplicate217.java

219:存在重复元素II https://github.com/g908682550/Demo/blob/master/src/leetcode/ContainsNearbyDuplicate219.java

220:存在重复元素III https://github.com/g908682550/Demo/blob/master/src/leetcode/ContainsNearbyAlmostDuplicate220.java

222:完全二叉树的节点个数 https://github.com/g908682550/Demo/blob/master/src/leetcode/CountNodes222.java

225:用队列实现栈 https://github.com/g908682550/Demo/blob/master/src/leetcode/MyStack225.java

226:翻转二叉树 https://github.com/g908682550/Demo/blob/master/src/leetcode/InvertTree226.java

230:二叉搜索树中第K小的元素 https://github.com/g908682550/Demo/blob/master/src/leetcode/KthSmallest230.java

232:用栈实现队列 https://github.com/g908682550/Demo/blob/master/src/leetcode/MyQueue232.java

234:回文链表 https://github.com/g908682550/Demo/blob/master/src/leetcode/IsPalindrome234.java

235:二叉搜索数的最近公共祖先 https://github.com/g908682550/Demo/blob/master/src/leetcode/LowestCommonAncestor235.java

237:删除链表中的节点 https://github.com/g908682550/Demo/blob/master/src/leetcode/DeleteNode237.java

242:有效的字母异位词 https://github.com/g908682550/Demo/blob/master/src/leetcode/IsAnagram242.java

257:二叉树的所有路径 https://github.com/g908682550/Demo/blob/master/src/leetcode/BinaryTreePaths257.java

279:完全平方数 https://github.com/g908682550/Demo/blob/master/src/leetcode/NumSquares279.java

283:移动零 https://github.com/g908682550/Demo/blob/master/src/leetcode/MoveZeros283.java

290:单词规律 https://github.com/g908682550/Demo/blob/master/src/leetcode/WordPattern290.java

322:零钱兑换 https://github.com/g908682550/Demo/blob/master/src/CoinChange322.java

328:奇偶链表 https://github.com/g908682550/Demo/blob/master/src/leetcode/OddEvenList328.java

337:打家劫舍III https://github.com/g908682550/Demo/blob/master/src/leetcode/Rob337.java

341:扁平化嵌套列表迭代器 https://github.com/g908682550/Demo/blob/master/src/leetcode/NestedIterator341.java

343:整数拆分https://github.com/g908682550/Demo/blob/master/src/leetcode/IntegerBreak343.java

344:反转字符串 https://github.com/g908682550/Demo/blob/master/src/leetcode/ReverseString344.java

347:前K个高频元素 https://github.com/g908682550/Demo/blob/master/src/leetcode/TopKFrequent347.java

349:两个数组的交集 https://github.com/g908682550/Demo/blob/master/src/leetcode/Intersection349.java

350:两个数组的交集II https://github.com/g908682550/Demo/blob/master/src/leetcode/Intersection350.java

376:摆动序列https://github.com/g908682550/Demo/blob/master/src/leetcode/WiggleMaxLength376.java

377:组合总和IV https://github.com/g908682550/Demo/blob/master/src/CombinationSum4377.java

392:判断子序列 https://github.com/g908682550/Demo/blob/master/src/leetcode/IsSubsequence392.java

401:二进制手表 https://github.com/g908682550/Demo/blob/master/src/leetcode/ReadBinaryWatch401.java

404:左叶子之和 https://github.com/g908682550/Demo/blob/master/src/leetcode/SumOfLeftLeaves404.java

416:分割等和子集 https://github.com/g908682550/Demo/blob/master/src/leetcode/CanPartition416.java

417:太平洋大西洋水流问题 https://github.com/g908682550/Demo/blob/master/src/leetcode/PacificAtlantic417.java

435:无重叠区间 https://github.com/g908682550/Demo/blob/master/src/leetcode/EraseOverlapIntervals435.java

437:路径总和III https://github.com/g908682550/Demo/blob/master/src/leetcode/PathSum437.java

438:找到字符串所有字母异位字 https://github.com/g908682550/Demo/blob/master/src/leetcode/FindAnagrams438.java

442:数组中重复的数据 https://github.com/g908682550/Demo/blob/master/src/leetcode/FindDuplicates442.java

445:两数相加II https://github.com/g908682550/Demo/blob/master/src/leetcode/AddTwoNumbers445.java

447: 回旋镖的数量 https://github.com/g908682550/Demo/blob/master/src/leetcode/NumberOfBoomeranges447.java

448:找到所有数组中消失的数字 https://github.com/g908682550/Demo/blob/master/src/leetcode/FindDisappearedNumbers448.java

450:删除二叉搜索树中的节点 https://github.com/g908682550/Demo/blob/master/src/leetcode/deleteNode.java

451:根据字符出现频率排序 https://github.com/g908682550/Demo/blob/master/src/leetcode/Intersection349.java

454: 四数相加II https://github.com/g908682550/Demo/blob/master/src/leetcode/FourSumCount454.java

494:目标和 https://github.com/g908682550/Demo/blob/master/src/leetcode/FindTargetSumWays494.java

645:错误的集合 https://github.com/g908682550/Demo/blob/master/src/leetcode/FindErrorNums645.java

695:岛屿的最大面积 https://github.com/g908682550/Demo/blob/master/src/leetcode/MaxAreaOfIsland695.java

733:图像渲染 https://github.com/g908682550/Demo/blob/master/src/leetcode/FloodFill733.java

752:打开转盘锁 https://github.com/g908682550/Demo/blob/master/src/leetcode/OpenLock752.java

773:滑动谜题 https://github.com/g908682550/Demo/blob/master/src/leetcode/SlidingPuzzle773.java

785:判断二分图 https://github.com/g908682550/Demo/blob/master/src/leetcode/isBipartite785.java

873:最长的斐波那契子序列的长度 https://github.com/g908682550/Demo/blob/master/src/leetcode/LenLongestFibSubseq.java

874:模拟行走机器人 https://github.com/g908682550/Demo/blob/master/src/leetcode/RobotSim874.java

876:链表的中间节点 https://github.com/g908682550/Demo/blob/master/src/leetcode/MiddleNode876.java

1091:二进制矩阵中的最短路径 https://github.com/g908682550/Demo/blob/master/src/leetcode/ShortestPathBinaryMatrix1091.java

###LeetCode每日一题

3/27 914:卡牌分组 https://github.com/g908682550/Demo/blob/master/src/leetcode/HasGroupsSizeX914.java

3/28 820: 单词的压缩编码 https://github.com/g908682550/Demo/blob/master/src/leetcode/MinimumLengthEncoding820.java

3/29 1162:地图分析 https://github.com/g908682550/Demo/blob/master/src/leetcode/MaxDistance1162.java

3/30 offer 62:圆圈中最后剩下的数字 https://github.com/g908682550/Algorithm-Demo/blob/master/src/offer/LastRemaining62.java

4/1 1111:有效括号的嵌套深度 https://github.com/g908682550/Demo/blob/master/src/leetcode/MaxDepthAfterSplit1111.java

4/2 289:生命游戏 https://github.com/g908682550/Demo/blob/master/src/leetcode/GameOfLife.java

4/3 8:字符串转整数 https://github.com/g908682550/Demo/blob/master/src/leetcode/MyAtoi8.java

4/5 460:LFU缓存 https://github.com/g908682550/Algorithm-Demo/blob/master/src/lfu/LFUCache1.java

4/7 48:旋转矩阵 https://github.com/g908682550/Demo/blob/master/src/leetcode/Rotate48.java>

4/8 offer 13:机器人运动范围 https://github.com/g908682550/Algorithm-Demo/blob/master/src/offer/MovingCount13.java

4/9 22:括号生成 https://github.com/g908682550/Demo/blob/master/src/leetcode/GenerateParenthesis22

4/11 887:鸡蛋掉落 https://github.com/g908682550/Demo/blob/master/src/leetcode/SuperEggDrop887.java

4/12 16.03 交点 https://github.com/g908682550/Demo/blob/master/src/leetcode/Intersection1603

4/13 355:设计推特 https://github.com/g908682550/Demo/blob/master/src/leetcode/Twgitter355.java

4/15 542:01矩阵 https://github.com/g908682550/Demo/blob/master/src/leetcode/UpdateMatrix542.java

4/16 56:合并区件 https://github.com/g908682550/Demo/blob/master/src/leetcode/Merge56.java

4/17 55:跳跃游戏 https://github.com/g908682550/Demo/blob/master/src/leetcode/CanJump55.java

4/19 466:统计重复个数 https://github.com/g908682550/Demo/blob/master/src/leetcode/GetMaxRepetitions466.java

4/21:1248 统计Γ优美子数组┐ https://github.com/g908682550/Demo/blob/master/src/leetcode/NumberOfSubarrays1248.java

4/23:518:零钱兑换II https://github.com/g908682550/Demo/blob/master/src/leetcode/Change518.java

4/24:offer 51:数组中的逆序对 https://github.com/g908682550/Algorithm-Demo/blob/master/src/offer/ReversePairs51.java

5/11:50:快速幂 https://github.com/g908682550/Demo/blob/master/src/leetcode/MyPow50.java

5/17 210:课程表II https://github.com/g908682550/Demo/blob/master/src/leetcode/FindOrder210.java

5/19 680:验证回文字符串 https://github.com/g908682550/Demo/blob/master/src/leetcode/validPalindrome680.java

5/20 1371:每个元音包含偶数次的最长子字符串 https://github.com/g908682550/Demo/blob/master/src/leetcode/FindTheLongestSubstring1371.java

6/1 1431:拥有最多糖果的孩子 https://github.com/g908682550/Demo/blob/master/src/leetcode/kidsWithCandies.java

6/3 837:新21点 https://github.com/g908682550/Demo/blob/master/src/leetcode/New21Game837.java

6/4 238:除自身外数组的乘积 https://github.com/g908682550/Demo/blob/master/src/leetcode/productExceptSelf.java

6/5 54:螺旋矩阵 https://github.com/g908682550/Demo/blob/master/src/leetcode/SpiralOrder54.java

6/6 127:最长连续序列 https://github.com/g908682550/Demo/blob/master/src/leetcode/LadderLength127.java

6/8 990:等式方程的可满足性 https://github.com/g908682550/Demo/blob/master/src/leetcode/EquationsPossible990.java

6/9 offer 46:把数字翻译成字符串 https://github.com/g908682550/Algorithm-Demo/blob/master/src/offer/TranslateNum46.java

6/10 9:回文数 https://github.com/g908682550/Demo/blob/master/src/leetcode/IsPalindrome9.java

6/11 739:每日温度 https://github.com/g908682550/Demo/blob/master/src/leetcode/DailyTemperatures739.java

6/14 1300:转变数组后最接近目标值的数组和 https://github.com/g908682550/Demo/blob/master/src/leetcode/FindBestValue1300.java

6/15 14:最长公共前缀 https://github.com/g908682550/Demo/blob/master/src/leetcode/LongestCommonPrefix14.java

6/16 297:二叉树的序列化和反序列化 https://github.com/g908682550/Demo/blob/master/src/leetcode/Codec297.java

6/17 1014:最佳观光组合 https://github.com/g908682550/Demo/blob/master/src/leetcode/MaxScoreSightseeingPair1014.java

6/18 1028:从先序遍历还原二叉树 https://github.com/g908682550/Demo/blob/master/src/leetcode/RecoverFromPreorder1028.java

6/19 125:验证回文串 https://github.com/g908682550/Demo/blob/master/src/leetcode/IsPalindrome125.java

6/22 16_18:模式匹配 https://github.com/g908682550/Demo/blob/master/src/leetcode/PatternMatching16_18.java

6/23 67:二进制求和 https://github.com/g908682550/Demo/blob/master/src/leetcode/AddBinary67.java

6/24 16:最接近三数之和 https://github.com/g908682550/Demo/blob/master/src/leetcode/ThreeSumClosest16.java

6/25 0201:移出重复节点 https://github.com/g908682550/Demo/blob/master/src/leetcode/RemoveDuplicateNodes0201.java

8/20 529:扫雷游戏 https://github.com/g908682550/Demo/blob/master/src/leetcode/UpdateBoard529.java

2021/01/12 1207:项目管理 https://github.com/g908682550/Demo/blob/master/src/leetcode/SortItems1203.java

分类

数组问题(包含双指针问题):

283:移动零 https://github.com/g908682550/Demo/blob/master/src/leetcode/MoveZeros283.java

27:移除元素 https://github.com/g908682550/Demo/blob/master/src/leetcode/RemoveElement27.java

26:删除排序数组中的重复项 https://github.com/g908682550/Demo/blob/master/src/leetcode/RemoveDuplicates26.java

80:删除排序数组中的重复项II https://github.com/g908682550/Demo/blob/master/src/leetcode/RemoveDuplicates80.java

75:颜色分类 https://github.com/g908682550/Demo/blob/master/src/leetcode/sortColors75.java

88:合并两个有序数组 https://github.com/g908682550/Demo/blob/master/src/leetcode/Merge88.java

215:数组中的第K个最大元素 https://github.com/g908682550/Demo/blob/master/src/leetcode/FindKthLargest215.java

167:两数之和II-输入有序数组 https://github.com/g908682550/Demo/blob/master/src/leetcode/TwoSum167.java

125:验证回文串 https://github.com/g908682550/Demo/blob/master/src/leetcode/IsPalindrome125.java

11:盛水最多的容器 https://github.com/g908682550/Demo/blob/master/src/leetcode/MaxArea11.java

137:只出现一次的数字II https://github.com/g908682550/Demo/blob/master/src/leetcode/SingleNumber.java

442:数组中重复的数据 https://github.com/g908682550/Demo/blob/master/src/leetcode/FindDuplicates442.java

排序问题:

41:缺失的第一个正数:https://github.com/g908682550/Demo/blob/master/src/leetcode/FirstMissingPositive41.java

169:多数元素 https://github.com/g908682550/Demo/blob/master/src/leetcode/MajorityElement169.java

滑动窗口

209:长度最小的子数组 https://github.com/g908682550/Demo/blob/master/src/leetcode/MinSubArrayLen209.java

3:无重复字符的最长子串 https://github.com/g908682550/Demo/blob/master/src/leetcode/LengthOfLongestSubstring3.java

438:找到字符串所有字母异位字 https://github.com/g908682550/Demo/blob/master/src/leetcode/FindAnagrams438.java

76:最小覆盖子串 https://github.com/g908682550/Demo/blob/master/src/leetcode/MinWindow76.java

30:串联所有单词的子串 https://github.com/g908682550/Demo/blob/master/src/leetcode/FindSubstring30.java

查找表问题(Set、Map)

349:两个数组的交集 https://github.com/g908682550/Demo/blob/master/src/leetcode/Intersection349.java

242:有效的字母异位词 https://github.com/g908682550/Demo/blob/master/src/leetcode/IsAnagram242.java

202:快乐数 https://github.com/g908682550/Demo/blob/master/src/leetcode/IsHappy202.java

451:根据字符出现频率排序 https://github.com/g908682550/Demo/blob/master/src/leetcode/Intersection349.java

205:同构字符串 https://github.com/g908682550/Demo/blob/master/src/leetcode/IsIsomorphic205.java

1:两数之和 https://github.com/g908682550/Demo/blob/master/src/leetcode/TwoSum1.java

15:三数之和 https://github.com/g908682550/Demo/blob/master/src/leetcode/ThreeSum15.java

16:最接近的三数之和 https://github.com/g908682550/Demo/blob/master/src/leetcode/ThreeSumClosest16.java

454: 四数相加II https://github.com/g908682550/Demo/blob/master/src/leetcode/FourSumCount454.java

49:字母异位词分组 https://github.com/g908682550/Demo/blob/master/src/leetcode/GroupAnagrams49.java

447: 回旋镖的数量 https://github.com/g908682550/Demo/blob/master/src/leetcode/NumberOfBoomeranges447.java

149:直线上最多的点数 https://github.com/g908682550/Demo/blob/master/src/leetcode/MaxPoints149.java

217:存在重复元素 https://github.com/g908682550/Demo/blob/master/src/leetcode/ContainsDuplicate217.java

219:存在重复元素II https://github.com/g908682550/Demo/blob/master/src/leetcode/ContainsNearbyDuplicate219.java(也为滑动窗口问题)

220:存在重复元素III https://github.com/g908682550/Demo/blob/master/src/leetcode/ContainsNearbyAlmostDuplicate220.java(也为滑动窗口问题)

链表问题

82:删除排序链表的重复元素II https://github.com/g908682550/Demo/blob/master/src/leetcode/DeleteDuplicates82.java//设定哑节点

83:删除排序链表中的重复元素 https://github.com/g908682550/Demo/blob/master/src/leetcode/DeleteDuplicates83.java

2:两数相加 https://github.com/g908682550/Demo/blob/master/src/leetcode/AddTwoNumbers2.java

86:分割链表https://github.com/g908682550/Demo/blob/master/src/leetcode/Partition86.java//注意尾部置为null

92:反转链表II https://github.com/g908682550/Demo/blob/master/src/leetcode/ReverseBetween92.java

203:移除链表元素 https://github.com/g908682550/Demo/blob/master/src/leetcode/RemoveElements203.java

206:反转链表 https://github.com/g908682550/Demo/blob/master/src/leetcode/ReverseList206.java

328:奇偶链表 https://github.com/g908682550/Demo/blob/master/src/leetcode/OddEvenList328.java

445:两数相加II https://github.com/g908682550/Demo/blob/master/src/leetcode/AddTwoNumbers445.java

21:合并两个有序链表 https://github.com/g908682550/Demo/blob/master/src/leetcode/MergeTwoLists21.java

24:两两交换链表中的节点 https://github.com/g908682550/Demo/blob/master/src/leetcode/SwapPairs24.java

25:K个一组翻转链表 https://github.com/g908682550/Demo/blob/master/src/leetcode/ReverseKGroup25.java

147:对链表进行插入排序 https://github.com/g908682550/Demo/blob/master/src/leetcode/InsertionSortList147.java

148:排序链表 https://github.com/g908682550/Demo/blob/master/src/leetcode/SortList148.java

237:删除链表中的节点 https://github.com/g908682550/Demo/blob/master/src/leetcode/DeleteNode237.java

19:删除链表的倒数第N个节点 https://github.com/g908682550/Demo/blob/master/src/leetcode/RemoveNthFromEnd19.java//快慢指针,慢指针为哑节点

61:旋转链表 https://github.com/g908682550/Demo/blob/master/src/leetcode/RotateRight61.java

143:重排链表 https://github.com/g908682550/Demo/blob/master/src/leetcode/ReorderList143.java

876:链表的中间节点 https://github.com/g908682550/Demo/blob/master/src/leetcode/MiddleNode876.java

234:回文链表 https://github.com/g908682550/Demo/blob/master/src/leetcode/IsPalindrome234.java

138:复制带随机链表的指针 https://github.com/g908682550/Demo/blob/master/src/leetcode/CopyRandomList138.java

142:环形链表II https://github.com/g908682550/Demo/blob/master/src/leetcode/DetectCycleII142

栈和队列

232:用栈实现队列 https://github.com/g908682550/Demo/blob/master/src/leetcode/MyQueue232.java

225:用队列实现栈 https://github.com/g908682550/Demo/blob/master/src/leetcode/MyStack225.java

20:有效的括号 https://github.com/g908682550/Demo/blob/master/src/leetcode/RemoveNthFromEnd19.java/IsValid20.java

150:逆波兰表达式求值 https://github.com/g908682550/Demo/blob/master/src/leetcode/RemoveNthFromEnd19.java/EvalRPN150.java

71:简化路径 https://github.com/g908682550/Demo/blob/master/src/leetcode/simplifyPath71.java

144:二叉树的前序遍历 https://github.com/g908682550/Demo/blob/master/src/leetcode/PreOrderTraversal144.java

145:二叉树的后序遍历 https://github.com/g908682550/Demo/blob/master/src/leetcode/PostOrderTraversal145

94:二叉树的中序遍历 https://github.com/g908682550/Demo/blob/master/src/leetcode/InorderTraversal94.java

341:扁平化嵌套列表迭代器 https://github.com/g908682550/Demo/blob/master/src/leetcode/NestedIterator341.java

102:二叉树的层次遍历 https://github.com/g908682550/Demo/blob/master/src/leetcode/LevelOrder102.java

103:二叉树的锯齿形层次遍历 https://github.com/g908682550/Demo/blob/master/src/leetcode/ZigzagLevelOrder103.java

107:二叉树的层次遍历II https://github.com/g908682550/Demo/blob/master/src/leetcode/LevelOrderBottom107.java

199:二叉树的右视图 https://github.com/g908682550/Demo/blob/master/src/leetcode/RightSideView199.java

279:完全平方数 https://github.com/g908682550/Demo/blob/master/src/leetcode/NumSquares279.java

127:单词接龙 https://github.com/g908682550/Demo/blob/master/src/leetcode/LadderLength127.java

347:前K个高频元素 https://github.com/g908682550/Demo/blob/master/src/leetcode/TopKFrequent347.java

32:最长有效括号 https://github.com/g908682550/Demo/blob/master/src/leetcode/LongestValidParentheses32.java

二叉树

104:二叉树的最大深度 https://github.com/g908682550/Demo/blob/master/src/leetcode/maxDepth104.java

111:二叉树的最小深度 https://github.com/g908682550/Demo/blob/master/src/leetcode/minDepth111.java

124:二叉树的最大路径和 https://github.com/g908682550/Demo/blob/master/src/leetcode/MaxPathSum124.java

226:翻转二叉树 https://github.com/g908682550/Demo/blob/master/src/leetcode/InvertTree226.java

100:相同的树 https://github.com/g908682550/Demo/blob/master/src/leetcode/IsSameTree100.java

101:对称二叉树 https://github.com/g908682550/Demo/blob/master/src/leetcode/IsSymmetric101.java

222:完全二叉树的节点个数 https://github.com/g908682550/Demo/blob/master/src/leetcode/CountNodes222.java

110:平衡二叉树 https://github.com/g908682550/Demo/blob/master/src/leetcode/IsBalanced110.java

112:路径总和 https://github.com/g908682550/Demo/blob/master/src/leetcode/HasPathSum112.java

113:路径总和II https://github.com/g908682550/Demo/blob/master/src/leetcode/PathSum113.java

437:路径总和III https://github.com/g908682550/Demo/blob/master/src/leetcode/PathSum437.java

404:左叶子之和 https://github.com/g908682550/Demo/blob/master/src/leetcode/SumOfLeftLeaves404.java

257:二叉树的所有路径 https://github.com/g908682550/Demo/blob/master/src/leetcode/BinaryTreePaths257.java

129:从根到叶子节点路径之和 https://github.com/g908682550/Demo/blob/master/src/leetcode/SumNumbers129.java

235:二叉搜索数的最近公共祖先 https://github.com/g908682550/Demo/blob/master/src/leetcode/LowestCommonAncestor235.java

98:验证二叉搜索树 https://github.com/g908682550/Demo/blob/master/src/leetcode/IsValidVBST98.java

450:删除二叉搜索树中的节点 https://github.com/g908682550/Demo/blob/master/src/leetcode/DeleteNode450.java

108:将有序数组转换为二叉搜索树 https://github.com/g908682550/Demo/blob/master/src/leetcode/SortedArrayToBST108.java

230:二叉搜索树中第K小的元素 https://github.com/g908682550/Demo/blob/master/src/leetcode/KthSmallest230.java

递归与回溯

17:电话号码的字母组合 https://github.com/g908682550/Demo/blob/master/src/leetcode/LetterCombinations17.java

93:复原IP地址 https://github.com/g908682550/Demo/blob/master/src/leetcode/RestoreIpAddress93.java

131:分割回文串 https://github.com/g908682550/Demo/blob/master/src/leetcode/Partition131.java

46:全排列 https://github.com/g908682550/Demo/blob/master/src/leetcode/Permute46.java

47:全排列II https://github.com/g908682550/Demo/blob/master/src/leetcode/PermuteUnique47.java

77:组合 https://github.com/g908682550/Demo/blob/master/src/leetcode/Combine77.java

40:组合总和II https://github.com/g908682550/Demo/blob/master/src/leetcode/CombinationSum240.java

216:组合总和III https://github.com/g908682550/Demo/blob/master/src/leetcode/CombinationSum3216.java

78:子集 https://github.com/g908682550/Demo/blob/master/src/leetcode/Subsets78.java

90:子集II https://github.com/g908682550/Demo/blob/master/src/leetcode/SubsetsWithDup90.java

401:二进制手表 https://github.com/g908682550/Demo/blob/master/src/leetcode/ReadBinaryWatch401.java

79:单词搜索 https://github.com/g908682550/Demo/blob/master/src/leetcode/Exist79.java

200:岛屿数量 https://github.com/g908682550/Demo/blob/master/src/leetcode/NumsIslands200.java

130:被围绕的区域 https://github.com/g908682550/Demo/blob/master/src/leetcode/Solve130.java

417:太平洋大西洋水流问题 https://github.com/g908682550/Demo/blob/master/src/leetcode/PacificAtlantic417.java

51:N皇后 https://github.com/g908682550/Demo/blob/master/src/leetcode/solveNQueens.java

60:第K个排列 https://github.com/g908682550/Demo/blob/master/src/leetcode/GetPermutation60.java

动态规划

70:爬楼梯 https://github.com/g908682550/Demo/blob/master/src/leetcode/ClimbStairs70.java

120:三角形最小路径和 https://github.com/g908682550/Demo/blob/master/src/leetcode/MinimumTotal120.java

64:最小路径和 https://github.com/g908682550/Demo/blob/master/src/leetcode/MinPathSum64.java

91:解码方法 https://github.com/g908682550/Demo/blob/master/src/leetcode/NumDecodings.java

62:不同路径 https://github.com/g908682550/Demo/blob/master/src/leetcode/UniquePaths62.java

63:不同路径II https://github.com/g908682550/Demo/blob/master/src/leetcode/UniquePathwWithObstacles63.java

152:乘积最大子数组 https://github.com/g908682550/Demo/blob/master/src/leetcode/MaxProduct152.java

198:打家劫舍 https://github.com/g908682550/Demo/blob/master/src/leetcode/Rob198.java

213:打家劫舍II https://github.com/g908682550/Demo/blob/master/src/leetcode/Rob213.java

337:打家劫舍III https://github.com/g908682550/Demo/blob/master/src/leetcode/Rob337.java

121:买卖股票的最佳时机 https://github.com/g908682550/Demo/blob/master/src/leetcode/MaxProfit121.java

122:买卖股票的最佳时机II https://github.com/g908682550/Demo/blob/master/src/MaxProfit122.java

123:买卖股票的最佳时机III https://github.com/g908682550/Demo/blob/master/src/MaxProfit123.java

376:摆动序列https://github.com/g908682550/Demo/blob/master/src/leetcode/WiggleMaxLength376.java

72:编辑距离 https://github.com/g908682550/Demo/blob/master/src/leetcode/MinDistance72.java

416:分割等和子集 https://github.com/g908682550/Demo/blob/master/src/leetcode/CanPartition416.java

322:零钱兑换 https://github.com/g908682550/Demo/blob/master/src/CoinChange322.java

377:组合总和IV https://github.com/g908682550/Demo/blob/master/src/CombinationSum4377.java

139:单词拆分 https://github.com/g908682550/Demo/blob/master/src/leetcode/WordBreak139.java

494:目标和 https://github.com/g908682550/Demo/blob/master/src/leetcode/FindTargetSumWays494.java

343:整数拆分https://github.com/g908682550/Demo/blob/master/src/leetcode/IntegerBreak343.java

5:最长回文子串 https://github.com/g908682550/Demo/blob/master/src/leetcode/LongestPalindrome5.java

132:分割回文串II https://github.com/g908682550/Demo/blob/master/src/leetcode/MinCut132.java

贪心算法

455:分发饼干 https://github.com/g908682550/Demo/blob/master/src/leetcode/FindContentChildren455.java

392:判断子序列 https://github.com/g908682550/Demo/blob/master/src/leetcode/IsSubsequence392.java

435:无重叠区间 https://github.com/g908682550/Demo/blob/master/src/leetcode/EraseOverlapIntervals435.java

图相关

785:判断二分图 https://github.com/g908682550/Demo/blob/master/src/leetcode/isBipartite785.java

695:岛屿的最大面积 https://github.com/g908682550/Demo/blob/master/src/leetcode/MaxAreaOfIsland695.java

733:图像渲染 https://github.com/g908682550/Demo/blob/master/src/leetcode/FloodFill733.java

1091:二进制矩阵中的最短路径 https://github.com/g908682550/Demo/blob/master/src/leetcode/ShortestPathBinaryMatrix1091.java

1034:边框着色 https://github.com/g908682550/Demo/blob/master/src/leetcode/ColorBorder1034.java

752:打开转盘锁 https://github.com/g908682550/Demo/blob/master/src/leetcode/OpenLock752.java

773:滑动谜题 https://github.com/g908682550/Demo/blob/master/src/leetcode/SlidingPuzzle773.java

994:腐烂的橘子 https://github.com/g908682550/Demo/blob/master/src/leetcode/OrangesRotting994.java

133:克隆图 https://github.com/g908682550/Demo/blob/master/src/leetcode/CloneGraph133.java

1311:获取你好友已观看的视频 https://github.com/g908682550/Demo/blob/master/src/leetcode/WatchedVideosByFriends1311.java

剑指Offer

3:数组中重复的数字 https://github.com/g908682550/Algorithm-Demo/blob/master/src/offer/FindRepeatNumber03.java

4:二维数组的查找 https://github.com/g908682550/Algorithm-Demo/blob/master/src/offer/FindNumberIn2DArray04.java

7:重建二叉树 https://github.com/g908682550/Algorithm-Demo/blob/master/src/offer/BuildTree07.java

11:旋转数组中的最小数字 https://github.com/g908682550/Algorithm-Demo/blob/master/src/offer/MinArray11.java

33:二叉搜索树的后序遍历序列 https://github.com/g908682550/Algorithm-Demo/blob/master/src/offer/VerifyPostorder33.java

41: 数据流中的中位数 https://github.com/g908682550/Algorithm-Demo/blob/master/src/offer/MedianFinder41.java

46:把数字翻译成字符串 https://github.com/g908682550/Algorithm-Demo/blob/master/src/offer/TranslateNum46.java

52:翻转单词顺序 https://github.com/g908682550/Algorithm-Demo/blob/master/src/offer/ReverseWords58.java

59:滑动窗口的最大值 https://github.com/g908682550/Algorithm-Demo/blob/master/src/offer/maxInWindows59.java

66:构建乘积数组 https://github.com/g908682550/Algorithm-Demo/blob/master/src/offer/ConstructArr66.java

37:序列化二叉树 https://github.com/g908682550/Algorithm-Demo/blob/master/src/offer/Codec37.java

60: n个骰子的点数 https://github.com/g908682550/Algorithm-Demo/blob/master/src/offer/TwoSum60.java

经典数据结构和算法

字符串匹配类:

暴力匹配算法:https://github.com/g908682550/Demo/blob/master/src/string_match/SimpleMatch.java

KMP算法: https://github.com/g908682550/Demo/blob/master/src/string_match/KMP.java

Kruskal最小生成树算法:https://github.com/g908682550/Algorithm-Demo/blob/master/src/graph/weightedgraph/Kruskal.java

Prim最小生成树算法:https://github.com/g908682550/Algorithm-Demo/blob/master/src/graph/weightedgraph/Prim.java

Dijkstra最短路径算法:https://github.com/g908682550/Algorithm-Demo/blob/master/src/graph/weightedgraph/Dijkstra.java

BellmanFord最短路径算法:https://github.com/g908682550/Algorithm-Demo/blob/master/src/graph/weightedgraph/BellmanFord.java

Floyed最短路径算法:https://github.com/g908682550/Algorithm-Demo/blob/master/src/graph/weightedgraph/Floyed.java

数据结构类:

红黑树插入实现:https://github.com/g908682550/Demo/blob/master/src/tree/RedBlackTree.java

基于最大堆的优先队列简易实现:https://github.com/g908682550/Demo/blob/master/src/queue/PriorityQueue.java

LRU算法:https://github.com/g908682550/Algorithm-Demo/blob/master/src/lru/LRUCache.java

线段树:https://github.com/g908682550/Algorithm-Demo/blob/master/src/tree/SegmentTree.java

字典树:https://github.com/g908682550/Algorithm-Demo/blob/master/src/tree/Trie.java

并查集:https://github.com/g908682550/Algorithm-Demo/blob/master/src/unionfind/UnionFind6.java

排序类:

冒泡排序:https://github.com/g908682550/Demo/blob/master/src/sort/PopSort.java

选择排序:https://github.com/g908682550/Demo/blob/master/src/sort/SelectSort.java

插入排序:https://github.com/g908682550/Demo/blob/master/src/sort/InsertSort.java

希尔排序:https://github.com/g908682550/Demo/blob/master/src/sort/ShellSort.java

快速排序:https://github.com/g908682550/Demo/blob/master/src/sort/QuickSort.java

归并排序:https://github.com/g908682550/Demo/blob/master/src/sort/MergeSort.java

堆排序: https://github.com/g908682550/Demo/blob/master/src/sort/HeapSort.java

计数排序:https://github.com/g908682550/Demo/blob/master/src/sort/CountingSort.java

About

算法的各类实现

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages