File tree
640 files changed
+1739
-1418
lines changed- basic/sorting
- CountingSort
- HeapSort
- InsertionSort
- MergeSort
- QuickSort
- ShellSort
- lcci
- 03.02.Min Stack
- 03.04.Implement Queue using Stacks
- 03.05.Sort of Stacks
- 03.06.Animal Shelter
- 04.01.Route Between Nodes
- 04.12.Paths with Sum
- 08.10.Color Fill
- 08.12.Eight Queens
- 10.10.Rank from Stream
- 16.02.Words Frequency
- 16.06.Smallest Difference
- 16.11.Diving Board
- 16.21.Sum Swap
- 16.25.LRU Cache
- 17.12.BiNode
- 17.17.Multi Search
- 17.19.Missing Two
- 17.20.Continuous Median
- 17.24.Max Submatrix
- lcof
- 面试题06. 从尾到头打印链表
- 面试题09. 用两个栈实现队列
- 面试题18. 删除链表的节点
- 面试题29. 顺时针打印矩阵
- 面试题30. 包含min函数的栈
- 面试题32 - I. 从上到下打印二叉树
- 面试题36. 二叉搜索树与双向链表
- 面试题40. 最小的k个数
- 面试题41. 数据流中的中位数
- 面试题43. 1~n整数中1出现的次数
- 面试题45. 把数组排成最小的数
- 面试题55 - II. 平衡二叉树
- 面试题56 - I. 数组中数字出现的次数
- 面试题57. 和为s的两个数字
- 面试题59 - II. 队列的最大值
- 面试题65. 不用加减乘除做加法
- 面试题67. 把字符串转换成整数
- lcof2
- 剑指 Offer II 005. 单词长度的最大乘积
- 剑指 Offer II 006. 排序数组中两个数字之和
- 剑指 Offer II 007. 数组中和为 0 的三个数
- 剑指 Offer II 013. 二维子矩阵的和
- 剑指 Offer II 029. 排序的循环链表
- 剑指 Offer II 030. 插入、删除和随机访问都是 O(1) 的容器
- 剑指 Offer II 031. 最近最少使用缓存
- 剑指 Offer II 036. 后缀表达式
- 剑指 Offer II 041. 滑动窗口的平均值
- 剑指 Offer II 042. 最近请求次数
- 剑指 Offer II 043. 往完全二叉树添加节点
- 剑指 Offer II 044. 二叉树每层的最大值
- 剑指 Offer II 055. 二叉搜索树迭代器
- 剑指 Offer II 057. 值和下标之差都在给定的范围内
- 剑指 Offer II 059. 数据流的第 K 大数值
- 剑指 Offer II 060. 出现频率最高的 k 个数字
- 剑指 Offer II 061. 和最小的 k 个数对
- 剑指 Offer II 062. 实现前缀树
- 剑指 Offer II 063. 替换单词
- 剑指 Offer II 064. 神奇的字典
- 剑指 Offer II 066. 单词之和
- 剑指 Offer II 067. 最大的异或
- 剑指 Offer II 070. 排序数组中只出现一次的数字
- 剑指 Offer II 071. 按权重生成随机数
- 剑指 Offer II 072. 求平方根
- 剑指 Offer II 074. 合并区间
- 剑指 Offer II 076. 数组中的第 k 大的数字
- 剑指 Offer II 083. 没有重复元素集合的全排列
- 剑指 Offer II 084. 含有重复元素集合的全排列
- 剑指 Offer II 086. 分割回文子字符串
- 剑指 Offer II 087. 复原 IP
- 剑指 Offer II 096. 字符串交织
- 剑指 Offer II 107. 矩阵中的距离
- 剑指 Offer II 108. 单词演变
- 剑指 Offer II 109. 开密码锁
- 剑指 Offer II 111. 计算除法
- lcp
- LCP 02. 分式化简
- LCP 09. 最小跳跃次数
- solution
- 0000-0099
- 0001.Two Sum
- 0008.String to Integer (atoi)
- 0011.Container With Most Water
- 0012.Integer to Roman
- 0013.Roman to Integer
- 0017.Letter Combinations of a Phone Number
- 0020.Valid Parentheses
- 0027.Remove Element
- 0031.Next Permutation
- 0032.Longest Valid Parentheses
- 0034.Find First and Last Position of Element in Sorted Array
- 0037.Sudoku Solver
- 0041.First Missing Positive
- 0042.Trapping Rain Water
- 0044.Wildcard Matching
- 0046.Permutations
- 0047.Permutations II
- 0051.N-Queens
- 0052.N-Queens II
- 0056.Merge Intervals
- 0057.Insert Interval
- 0059.Spiral Matrix II
- 0060.Permutation Sequence
- 0065.Valid Number
- 0067.Add Binary
- 0068.Text Justification
- 0069.Sqrt(x)
- 0076.Minimum Window Substring
- 0081.Search in Rotated Sorted Array II
- 0091.Decode Ways
- 0093.Restore IP Addresses
- 0097.Interleaving String
- 0100-0199
- 0102.Binary Tree Level Order Traversal
- 0103.Binary Tree Zigzag Level Order Traversal
- 0107.Binary Tree Level Order Traversal II
- 0116.Populating Next Right Pointers in Each Node
- 0117.Populating Next Right Pointers in Each Node II
- 0123.Best Time to Buy and Sell Stock III
- 0127.Word Ladder
- 0146.LRU Cache
- 0150.Evaluate Reverse Polish Notation
- 0155.Min Stack
- 0167.Two Sum II - Input Array Is Sorted
- 0170.Two Sum III - Data structure design
- 0173.Binary Search Tree Iterator
- 0174.Dungeon Game
- 0199.Binary Tree Right Side View
- 0200-0299
- 0203.Remove Linked List Elements
- 0208.Implement Trie (Prefix Tree)
- 0211.Design Add and Search Words Data Structure
- 0212.Word Search II
- 0215.Kth Largest Element in an Array
- 0220.Contains Duplicate III
- 0222.Count Complete Tree Nodes
- 0225.Implement Stack using Queues
- 0227.Basic Calculator II
- 0232.Implement Queue using Stacks
- 0233.Number of Digit One
- 0235.Lowest Common Ancestor of a Binary Search Tree
- 0246.Strobogrammatic Number
- 0247.Strobogrammatic Number II
- 0258.Add Digits
- 0271.Encode and Decode Strings
- 0278.First Bad Version
- 0280.Wiggle Sort
- 0281.Zigzag Iterator
- 0282.Expression Add Operators
- 0284.Peeking Iterator
- 0286.Walls and Gates
- 0288.Unique Word Abbreviation
- 0289.Game of Life
- 0295.Find Median from Data Stream
- 0300-0399
- 0300.Longest Increasing Subsequence
- 0303.Range Sum Query - Immutable
- 0304.Range Sum Query 2D - Immutable
- 0305.Number of Islands II
- 0306.Additive Number
- 0307.Range Sum Query - Mutable
- 0308.Range Sum Query 2D - Mutable
- 0312.Burst Balloons
- 0315.Count of Smaller Numbers After Self
- 0317.Shortest Distance from All Buildings
- 0318.Maximum Product of Word Lengths
- 0327.Count of Range Sum
- 0333.Largest BST Subtree
- 0335.Self Crossing
- 0336.Palindrome Pairs
- 0345.Reverse Vowels of a String
- 0346.Moving Average from Data Stream
- 0347.Top K Frequent Elements
- 0348.Design Tic-Tac-Toe
- 0352.Data Stream as Disjoint Intervals
- 0354.Russian Doll Envelopes
- 0355.Design Twitter
- 0359.Logger Rate Limiter
- 0362.Design Hit Counter
- 0371.Sum of Two Integers
- 0372.Super Pow
- 0373.Find K Pairs with Smallest Sums
- 0374.Guess Number Higher or Lower
- 0379.Design Phone Directory
- 0380.Insert Delete GetRandom O(1)
- 0381.Insert Delete GetRandom O(1) - Duplicates allowed
- 0382.Linked List Random Node
- 0384.Shuffle an Array
- 0391.Perfect Rectangle
- 0398.Random Pick Index
- 0399.Evaluate Division
- 0400-0499
- 0405.Convert a Number to Hexadecimal
- 0407.Trapping Rain Water II
- 0410.Split Array Largest Sum
- 0414.Third Maximum Number
- 0417.Pacific Atlantic Water Flow
- 0421.Maximum XOR of Two Numbers in an Array
- 0423.Reconstruct Original Digits from English
- 0427.Construct Quad Tree
- 0429.N-ary Tree Level Order Traversal
- 0432.All O`one Data Structure
- 0436.Find Right Interval
- 0440.K-th Smallest in Lexicographical Order
- 0456.132 Pattern
- 0464.Can I Win
- 0472.Concatenated Words
- 0474.Ones and Zeroes
- 0483.Smallest Good Base
- 0487.Max Consecutive Ones II
- 0490.The Maze
- 0492.Construct the Rectangle
- 0493.Reverse Pairs
- 0497.Random Point in Non-overlapping Rectangles
- 0499.The Maze III
- 0500-0599
- 0502.IPO
- 0505.The Maze II
- 0506.Relative Ranks
- 0513.Find Bottom Left Tree Value
- 0515.Find Largest Value in Each Tree Row
- 0519.Random Flip Matrix
- 0520.Detect Capital
- 0522.Longest Uncommon Subsequence II
- 0524.Longest Word in Dictionary through Deleting
- 0528.Random Pick with Weight
- 0540.Single Element in a Sorted Array
- 0542.01 Matrix
- 0543.Diameter of Binary Tree
- 0549.Binary Tree Longest Consecutive Sequence II
- 0556.Next Greater Element III
- 0558.Logical OR of Two Binary Grids Represented as Quad-Trees
- 0564.Find the Closest Palindrome
- 0572.Subtree of Another Tree
- 0576.Out of Boundary Paths
- 0587.Erect the Fence
- 0588.Design In-Memory File System
- 0590.N-ary Tree Postorder Traversal
- 0600-0699
- 0616.Add Bold Tag in String
- 0622.Design Circular Queue
- 0633.Sum of Square Numbers
- 0637.Average of Levels in Binary Tree
- 0638.Shopping Offers
- 0640.Solve the Equation
- 0641.Design Circular Deque
- 0642.Design Search Autocomplete System
- 0645.Set Mismatch
- 0648.Replace Words
- 0654.Maximum Binary Tree
- 0657.Robot Return to Origin
- 0675.Cut Off Trees for Golf Event
- 0676.Implement Magic Dictionary
- 0677.Map Sum Pairs
- 0679.24 Game
- 0681.Next Closest Time
- 0683.K Empty Slots
- 0685.Redundant Connection II
- 0687.Longest Univalue Path
- 0689.Maximum Sum of 3 Non-Overlapping Subarrays
- 0691.Stickers to Spell Word
- 0693.Binary Number with Alternating Bits
- 0694.Number of Distinct Islands
- 0697.Degree of an Array
- 0698.Partition to K Equal Sum Subsets
- 0699.Falling Squares
- 0700-0799
- 0703.Kth Largest Element in a Stream
- 0705.Design HashSet
- 0706.Design HashMap
- 0707.Design Linked List
- 0708.Insert into a Sorted Circular Linked List
- 0710.Random Pick with Blacklist
- 0711.Number of Distinct Islands II
- 0712.Minimum ASCII Delete Sum for Two Strings
- 0715.Range Module
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
640 files changed
+1739
-1418
lines changedDiff for: .clang-format
+143-4
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
1 | 140 |
| |
2 | 141 |
| |
3 | 142 |
| |
| |||
107 | 246 |
| |
108 | 247 |
| |
109 | 248 |
| |
110 |
| - | |
| 249 | + | |
111 | 250 |
| |
112 | 251 |
| |
113 | 252 |
| |
114 |
| - | |
| 253 | + | |
115 | 254 |
| |
116 | 255 |
| |
117 | 256 |
| |
118 | 257 |
| |
119 |
| - | |
| 258 | + | |
120 | 259 |
| |
121 | 260 |
| |
122 | 261 |
| |
123 | 262 |
| |
124 |
| - | |
| 263 | + | |
125 | 264 |
| |
126 | 265 |
| |
127 | 266 |
| |
|
+2-1
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 |
| - | |
| 1 | + | |
| 2 | + | |
2 | 3 |
| |
3 | 4 |
| |
4 | 5 |
| |
|
Diff for: basic/sorting/HeapSort/Main.java
+4-4
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3 | 3 |
| |
4 | 4 |
| |
5 | 5 |
| |
6 |
| - | |
| 6 | + | |
7 | 7 |
| |
8 | 8 |
| |
9 | 9 |
| |
| |||
20 | 20 |
| |
21 | 21 |
| |
22 | 22 |
| |
23 |
| - | |
| 23 | + | |
24 | 24 |
| |
25 | 25 |
| |
26 | 26 |
| |
| |||
34 | 34 |
| |
35 | 35 |
| |
36 | 36 |
| |
37 |
| - | |
| 37 | + | |
38 | 38 |
| |
39 | 39 |
| |
40 | 40 |
| |
41 | 41 |
| |
42 | 42 |
| |
43 | 43 |
| |
44 |
| - | |
| 44 | + | |
45 | 45 |
| |
46 | 46 |
| |
47 | 47 |
| |
|
+1-1
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5 | 5 |
| |
6 | 6 |
| |
7 | 7 |
| |
8 |
| - | |
| 8 | + | |
9 | 9 |
| |
10 | 10 |
| |
11 | 11 |
| |
|
Diff for: basic/sorting/MergeSort/Main.java
+2-3
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2 | 2 |
| |
3 | 3 |
| |
4 | 4 |
| |
5 |
| - | |
| 5 | + | |
6 | 6 |
| |
7 | 7 |
| |
8 | 8 |
| |
| |||
15 | 15 |
| |
16 | 16 |
| |
17 | 17 |
| |
18 |
| - | |
| 18 | + | |
19 | 19 |
| |
20 | 20 |
| |
21 | 21 |
| |
| |||
30 | 30 |
| |
31 | 31 |
| |
32 | 32 |
| |
33 |
| - | |
34 | 33 |
| |
35 | 34 |
| |
36 | 35 |
| |
|
Diff for: basic/sorting/QuickSort/Main.java
+5-3
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
13 | 13 |
| |
14 | 14 |
| |
15 | 15 |
| |
16 |
| - | |
| 16 | + | |
17 | 17 |
| |
18 | 18 |
| |
19 | 19 |
| |
20 | 20 |
| |
21 | 21 |
| |
22 | 22 |
| |
23 | 23 |
| |
24 |
| - | |
25 |
| - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
26 | 28 |
| |
27 | 29 |
| |
28 | 30 |
| |
|
Diff for: basic/sorting/ShellSort/ShellSort.java
+1-1
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
20 | 20 |
| |
21 | 21 |
| |
22 | 22 |
| |
23 |
| - | |
| 23 | + | |
24 | 24 |
| |
25 | 25 |
|
Diff for: lcci/03.02.Min Stack/Solution.java
+4-4
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
15 | 15 |
| |
16 |
| - | |
| 16 | + | |
17 | 17 |
| |
18 | 18 |
| |
19 | 19 |
| |
20 | 20 |
| |
21 |
| - | |
| 21 | + | |
22 | 22 |
| |
23 | 23 |
| |
24 | 24 |
| |
25 |
| - | |
| 25 | + | |
26 | 26 |
| |
27 | 27 |
| |
28 | 28 |
| |
|
+4-4
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7 | 7 |
| |
8 | 8 |
| |
9 | 9 |
| |
10 |
| - | |
| 10 | + | |
11 | 11 |
| |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
15 |
| - | |
| 15 | + | |
16 | 16 |
| |
17 | 17 |
| |
18 | 18 |
| |
| |||
22 | 22 |
| |
23 | 23 |
| |
24 | 24 |
| |
25 |
| - | |
| 25 | + | |
26 | 26 |
| |
27 | 27 |
| |
28 | 28 |
| |
| |||
32 | 32 |
| |
33 | 33 |
| |
34 | 34 |
| |
35 |
| - | |
| 35 | + | |
36 | 36 |
| |
37 | 37 |
| |
38 | 38 |
| |
|
Diff for: lcci/03.05.Sort of Stacks/Solution.java
+4-4
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3 | 3 |
| |
4 | 4 |
| |
5 | 5 |
| |
6 |
| - | |
| 6 | + | |
7 | 7 |
| |
8 | 8 |
| |
9 | 9 |
| |
| |||
14 | 14 |
| |
15 | 15 |
| |
16 | 16 |
| |
17 |
| - | |
| 17 | + | |
18 | 18 |
| |
19 | 19 |
| |
20 | 20 |
| |
21 | 21 |
| |
22 | 22 |
| |
23 |
| - | |
| 23 | + | |
24 | 24 |
| |
25 | 25 |
| |
26 | 26 |
| |
27 |
| - | |
| 27 | + | |
28 | 28 |
| |
29 | 29 |
| |
30 | 30 |
| |
|
0 commit comments