【目录】LeetCode Java实现

这里记录一下自己刷的LeetCode题目。

有些博客用英文阐述自己的思路和收获,相当于练习一下英文的表达能力。

比较好的题目有加粗

题目以后将按题型分类,可以从目录寻找相关的分类。 

 

数组

简单题

26. Remove Duplicates from Sorted Array

122. Best Time to Buy and Sell Stock II

189. Rotate Array

217. Contains Duplicate

136. Single Number (思想很好)

350. Intersection of Two Arrays II

66. Plus One

283. Move Zeroes

1. Two Sum

219. Contains Duplicate II

中等题

36. Valid Sudoku

48. Rotate Image

220. Contains Duplicate III

 

 

字符串

简单题

344. Reverse String

7. Reverse Integer

387. First Unique Character in a String

242. Valid Anagram

125. Valid Palindrome

28. Implement strStr() KMP

38. Count and Say

14. Longest Common Prefix

中等题

8. String to Integer (atoi) 溢出的处理

 

链表

简单

206. Reverse Linked List

21. Merge Two Sorted Lists

234. Palindrome Linked List

141. Linked List Cycle

中等

19. Remove Nth Node From End of List

 

简单

104. Maximum Depth of Binary Tree

 

中等

98. Validate Binary Search Tree(还行)

230. Kth Smallest Element in a BST

94. Binary Tree Inorder Traversal

144. Binary Tree Preorder Traversal

102. Binary Tree Level Order Traversal

困难

145. Binary Tree Postorder Traversal

 

双指针类问题

利用双指针遍历数组、字符串等。

167. Two Sum II - Input array is sorted

633. Sum of Square Numbers

345. Reverse Vowels of a String

680. Valid Palindrome II

 

20. Valid Parentheses

 

 

待分类

3. Longest Substring Without Repeating Characters

5. Longest Palindromic Substring

9. Palindrome Number

32. Longest Valid Parentheses

65. Valid Number

74. Search a 2D Matrix

142. Linked List Cycle II

151. Reverse Words in a String

157. Read N Characters Given Read4

158. Read N Characters Given Read4 II - Call multiple times

159. Longest Substring with At Most Two Distinct Characters

161. One Edit Distance

163. Missing Range

170. Two Sum III – Data structure design

240. Search a 2D Matrix II

287. Find the Duplicate Number

557. Reverse Words in a String III

 

posted @ 2018-11-18 11:27  华仔要长胖  阅读(2875)  评论(0编辑  收藏  举报