LeetCode刷题之旅——算法很苦,但生活更苦

LeetCode部分算法题解题思路

算法能力真的是程序员水平的分水岭,也许你的工作中短时间之内还用不到,对于工作年头短或者一直从事简单业务的程序员来说,算法确实对工作没什么帮助,但是如果你有了想要进步,跳槽,或者精进技术的一些想法,不可避免的你就会接触一些开源项目,设计,思想以及面试,你会发现在这个过程中算法每时每刻都在影响着你,所以这东西就像是吃下去的饭一样,可能你吃下去你都忘记了味道,短时间也看不到给你身体带来什么变化,但是它会变成你的骨头和肉,永远存在于你的身体里,算法我觉得也是这样,说出一个问题,身体和大脑应该能够自动的去反应解决方法才是真的nb,刷算法很难,学习的路也很孤独,但是这才是坚持的意义呀。

这里是之前在github上一直更新的部分解答,现在搬到csdn上来了,我每天大概是刷两道题左右,一般都是实时更新到github上,csdn这边大概以后每周更新一次,题目的选择一般是leetcode上评价比较好的easy和medium题目,这么选的原因是因为有些题目踩的人很多,一个可能是题目本身很坑,有的题可能只是一道数学题而已,偏离了算法的本质,有的题为了难度而设置奇怪的条件,这些其实都是没必要的,纯属浪费时间,另外一些hard难度的题确实也不错,但是奈何实力有限,hard级别确实做起来很费劲,而且一般面试过程中以easy和medium为主,这也算是功利一些的理由吧,毕竟如果不是为了生活,谁愿意委屈自己呢。。。


数组

1.Two Sum
15.Three Sum
33.Search in Rotated Sorted Array
34.Find First and Last Position of Element in Sorted Array
35.Search Insert Position
39.Combination Sum
40.Combination Sum II
41.First Missing Positive
45.Jump Game II
48.Rotate Image
49.Group Anagrams
53.Maximum Subarray
73.Set Matrix Zeros
74. Search a 2D Matrix
75. Sort Colors
79. Word Search
118. Pascal’s Triangle
119. Pascal’s Triangle II
121. Best Time to Buy and Sell Stock
122. Best Time to Buy and Sell Stock II
123. Best Time to Buy and Sell Stock III
128. Longest Consecutive Sequence
136. Single Number
136. Single Number II

字符串

3.Longest Substring Without Repeating Characters
5.Longest Palindromic Substring
20. Valid Parentheses

链表

19. Remove Nth Node From End of List
21. Merge Two Sorted Lists
23. Merge k Sorted Lists
24. Swap Nodes in Pairs
83. Remove Duplicates from Sorted List
92. Reverse Linked List II
141. Linked List Cycle
142. Linked List Cycle II
143. Reorder List

回溯

22. Generate Parentheses
46. Permutations
46. PermutationsII
77. Combinations
78. Subsets
90. SubsetsII
131. Palindrome Partitioning

动态规划

32. Longest Valid Parentheses
62. Unique Paths
63. Unique PathsII
64. Minimum Path Sum
96. Unique Binary Search Trees
120. Triangle

贪心算法

55.Jump Game II

98. Validate Binary Search Tree
100. Same Tree
101. Symmetric Tree
102. Binary Tree Level Order Traversal
103. Binary Tree Zigzag Level Order Traversal
104. Maximum Depth of Binary Tree
105. Construct Binary Tree from Preorder and Inorder Traversal
106. Construct Binary Tree from Inorder and Postorder Traversal
107. Binary Tree Level Order Traversal II
108. Convert Sorted Array to Binary Search Tree
109. Convert Sorted List to Binary Search Tree
110. Balanced Binary Tree
112. Path Sum
113. Path Sum II
114. Flatten Binary Tree to Linked List
124. Binary Tree Maximum Path Sum
129. Sum Root to Leaf Numbers

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值