Skip to content

Commit 4404b9b

Browse files
committed
Chapter 03 codes comments updated.
1 parent 0ab915d commit 4404b9b

File tree

40 files changed

+117
-5
lines changed

40 files changed

+117
-5
lines changed

03-Using-Array/Course Code (C++)/03-Move-Zeroes/main.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
using namespace std;
55

6+
// 283. Move Zeroes
7+
// https://leetcode.com/problems/move-zeroes/description/
68
// 时间复杂度: O(n)
79
// 空间复杂度: O(n)
810
class Solution {

03-Using-Array/Course Code (C++)/04-Move-Zeroes-II/main.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
using namespace std;
55

6+
// 283. Move Zeroes
7+
// https://leetcode.com/problems/move-zeroes/description/
68
// 时间复杂度: O(n)
79
// 空间复杂度: O(n)
810
class Solution {

03-Using-Array/Course Code (C++)/04-Move-Zeroes-II/main2.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33

44
using namespace std;
55

6+
// 283. Move Zeroes
7+
// https://leetcode.com/problems/move-zeroes/description/
8+
//
69
// 原地(in place)解决该问题
710
// 时间复杂度: O(n)
811
// 空间复杂度: O(1)

03-Using-Array/Course Code (C++)/04-Move-Zeroes-II/main3.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33

44
using namespace std;
55

6+
// 283. Move Zeroes
7+
// https://leetcode.com/problems/move-zeroes/description/
8+
//
69
// 原地(in place)解决该问题
710
// 时间复杂度: O(n)
811
// 空间复杂度: O(1)

03-Using-Array/Course Code (C++)/04-Move-Zeroes-II/main4.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33

44
using namespace std;
55

6+
// 283. Move Zeroes
7+
// https://leetcode.com/problems/move-zeroes/description/
8+
//
69
// 原地(in place)解决该问题
710
// 时间复杂度: O(n)
811
// 空间复杂度: O(1)

03-Using-Array/Course Code (C++)/05-Sort-Colors/main.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
using namespace std;
66

7+
// 75. Sort Colors
8+
// https://leetcode.com/problems/sort-colors/description/
9+
//
710
// 计数排序的思路
811
// 对整个数组遍历了两遍
912
// 时间复杂度: O(n)

03-Using-Array/Course Code (C++)/05-Sort-Colors/main2.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
using namespace std;
66

7+
// 75. Sort Colors
8+
// https://leetcode.com/problems/sort-colors/description/
9+
//
710
// 三路快速排序的思想
811
// 对整个数组只遍历了一遍
912
// 时间复杂度: O(n)

03-Using-Array/Course Code (C++)/06-Two-Sum-II/main.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
using namespace std;
66

7+
// 167. Two Sum II - Input array is sorted
8+
// https://leetcode.com/problems/two-sum-ii-input-array-is-sorted/description/
9+
//
710
// 暴力枚举法
811
// 时间复杂度: O(n^2)
912
// 空间复杂度: O(1)

03-Using-Array/Course Code (C++)/06-Two-Sum-II/main2.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
using namespace std;
66

7+
// 167. Two Sum II - Input array is sorted
8+
// https://leetcode.com/problems/two-sum-ii-input-array-is-sorted/description/
9+
//
710
// 二分搜索法
811
// 时间复杂度: O(nlogn)
912
// 空间复杂度: O(1)

03-Using-Array/Course Code (C++)/06-Two-Sum-II/main3.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
using namespace std;
66

7+
// 167. Two Sum II - Input array is sorted
8+
// https://leetcode.com/problems/two-sum-ii-input-array-is-sorted/description/
9+
//
710
// 对撞指针
811
// 时间复杂度: O(n)
912
// 空间复杂度: O(1)

0 commit comments

Comments
 (0)