【目录】LeetCode Java实现
这里记录一下自己刷的LeetCode题目。
有些博客用英文阐述自己的思路和收获,相当于练习一下英文的表达能力。
比较好的题目有加粗。
题目以后将按题型分类,可以从目录寻找相关的分类。
数组
简单题
26. Remove Duplicates from Sorted Array
122. Best Time to Buy and Sell Stock II
136. Single Number (思想很好)
350. Intersection of Two Arrays II
中等题
字符串
简单题
387. First Unique Character in a String
中等题
8. String to Integer (atoi) 溢出的处理
链表
简单
中等
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
345. Reverse Vowels of a String
栈
待分类
3. Longest Substring Without Repeating Characters
5. Longest Palindromic Substring
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
170. Two Sum III – Data structure design
287. Find the Duplicate Number
557. Reverse Words in a String III