Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wwwanlingxiao
LeetCodeAnimation
Commits
5dee53d9
Commit
5dee53d9
authored
Nov 14, 2019
by
程序员吴师兄
Browse files
更换图片地址
parent
18798af8
Changes
68
Hide whitespace changes
Inline
Side-by-side
notes/LeetCode第24号问题:两两交换链表中的节点.md
View file @
5dee53d9
...
...
@@ -36,7 +36,7 @@
### 动画描述


### 代码实现
...
...
@@ -76,4 +76,4 @@ public:

\ No newline at end of file

\ No newline at end of file
notes/LeetCode第268号问题:缺失数字.md
View file @
5dee53d9
...
...
@@ -16,7 +16,7 @@
你的算法应该具有线性时间复杂度。 你可以不使用额外空间来实现吗?


## 题目解析
...
...
@@ -32,7 +32,7 @@
将少了一个数的数组与 0 到 n 之间完整的那个数组进行异或处理,因为相同的数字异或会变为了 0 ,那么全部数字异或后,剩下的就是少了的那个数字。


#### 代码实现1
...
...
@@ -75,7 +75,7 @@ class Solution {
-
遍历数组计算出原始数组中数字的累积和
-
两和相减,差值就是丢失的那个数字


```
java
//小吴之前担心会数据溢出,不过估计这题考察的不是这个,所以测试用例没写这种吧,还是能 AC 的
...
...
@@ -123,4 +123,4 @@ public class Solution {

\ No newline at end of file

\ No newline at end of file
notes/LeetCode第26号问题:删除排序数组中的重复项.md
View file @
5dee53d9
...
...
@@ -62,7 +62,7 @@ for (int i = 0; i < len; i++) {
### 动画描述


...
...
@@ -90,4 +90,4 @@ public:

\ No newline at end of file

\ No newline at end of file
notes/LeetCode第279号问题:完全平方数.md
View file @
5dee53d9
...
...
@@ -73,7 +73,7 @@ public int numSquares(int n) {
### 动画描述


### 代码实现
...
...
@@ -117,4 +117,4 @@ class Solution {

\ No newline at end of file

\ No newline at end of file
notes/LeetCode第283号问题:移动零.md
View file @
5dee53d9
...
...
@@ -32,7 +32,7 @@
动画如下:


代码如下:
...
...
@@ -68,7 +68,7 @@ public:
动画如下:


代码如下:
...
...
@@ -101,7 +101,7 @@ public:
动画如下:


代码如下:
```
...
...
@@ -134,4 +134,4 @@ public:

\ No newline at end of file

\ No newline at end of file
notes/LeetCode第295号问题:数据流的中位数.md
View file @
5dee53d9
...
...
@@ -49,7 +49,7 @@ findMedian() -> 2
### 动画描述


### 代码实现
...
...
@@ -91,4 +91,4 @@ class MedianFinder {

\ No newline at end of file

\ No newline at end of file
notes/LeetCode第2号问题:两数相加.md
View file @
5dee53d9
...
...
@@ -28,7 +28,7 @@
### 动画描述


### 代码实现
...
...
notes/LeetCode第301号问题:删除无效的括号.md
View file @
5dee53d9
...
...
@@ -160,4 +160,4 @@ public class Solution {

\ No newline at end of file

\ No newline at end of file
notes/LeetCode第326号问题:3的幂.md
View file @
5dee53d9
...
...
@@ -55,4 +55,4 @@ class Solution {

\ No newline at end of file

\ No newline at end of file
notes/LeetCode第328号问题:奇偶链表.md
View file @
5dee53d9
...
...
@@ -41,7 +41,7 @@
### 动画描述


### 代码实现
...
...
@@ -86,4 +86,4 @@ public:

\ No newline at end of file

\ No newline at end of file
notes/LeetCode第342号问题:4的幂.md
View file @
5dee53d9
...
...
@@ -77,13 +77,13 @@ class Solution {
将这个二进制数转换成 16 进制表示:0x55555555 。有没有感觉逼格更高点。。。


### 图片描述


...
...
notes/LeetCode第344号问题:反转字符串.md
View file @
5dee53d9
...
...
@@ -59,4 +59,4 @@ public:

\ No newline at end of file

\ No newline at end of file
notes/LeetCode第347号问题:前K个高频元素.md
View file @
5dee53d9
...
...
@@ -37,7 +37,7 @@
以下十种排序算法,任你挑选!


可以发现,使用常规的诸如 冒泡、选择、甚至快速排序都是不满足题目要求,它们的时间复杂度都是大于或者等于 O(n logn) ,而题目要求算法的时间复杂度必须优于 O(n log n) 。
...
...
@@ -50,7 +50,7 @@
题目最终需要返回的是前 k 个频率最大的元素,可以想到借助堆这种数据结构,对于 k 频率之后的元素不用再去处理,进一步优化时间复杂度。


具体操作为:
...
...
@@ -62,7 +62,7 @@


代码如下:
...
...
@@ -115,7 +115,7 @@ class Solution {
首先依旧使用哈希表统计频率,统计完成后,创建一个数组,将频率作为数组下标,对于出现频率不同的数字集合,存入对应的数组下标即可。


代码实现如下:
...
...
notes/LeetCode第349号问题:两个数组的交集.md
View file @
5dee53d9
...
...
@@ -39,7 +39,7 @@
### 动画描述


### 代码实现
...
...
@@ -72,4 +72,4 @@ public:

\ No newline at end of file

\ No newline at end of file
notes/LeetCode第350号问题:两个数组的交集II.md
View file @
5dee53d9
...
...
@@ -44,7 +44,7 @@
### 动画描述


### 代码实现
...
...
@@ -77,8 +77,8 @@ public:
#### 执行结果



\ No newline at end of file

\ No newline at end of file
notes/LeetCode第3号问题:无重复字符的最长子串.md
View file @
5dee53d9
...
...
@@ -31,7 +31,7 @@
### 动画描述


### 代码实现
...
...
notes/LeetCode第445号问题:两数相加II.md
View file @
5dee53d9
...
...
@@ -66,4 +66,4 @@ class Solution:

\ No newline at end of file

\ No newline at end of file
notes/LeetCode第447号问题:回旋镖的数量.md
View file @
5dee53d9
...
...
@@ -50,7 +50,7 @@ n 最大为 500,可以使用时间复杂度为 O(n^2)的算法。
### 动画描述


### 代码实现
...
...
@@ -96,4 +96,4 @@ private:

\ No newline at end of file

\ No newline at end of file
notes/LeetCode第454号问题:四数相加II.md
View file @
5dee53d9
...
...
@@ -41,7 +41,7 @@ D = [ 0, 2]
### 动画描述


### 代码实现
...
...
@@ -82,4 +82,4 @@ public:

\ No newline at end of file

\ No newline at end of file
notes/LeetCode第642号问题:设计一个搜索自动完成系统.md
View file @
5dee53d9
...
...
@@ -204,4 +204,4 @@ private:

\ No newline at end of file

\ No newline at end of file
Prev
1
2
3
4
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment