Skip to content

Commit 22ab628

Browse files
authored
update 0541.反转字符串II:添加复杂度分析
1 parent 62a9b6c commit 22ab628

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

problems/0541.反转字符串II.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ public:
6565
};
6666
```
6767
68+
* 时间复杂度: O(n)
69+
* 空间复杂度: O(1)
70+
6871
6972
7073
@@ -96,6 +99,9 @@ public:
9699
};
97100
```
98101

102+
* 时间复杂度: O(n)
103+
* 空间复杂度: O(1)或O(n), 取决于使用的语言中字符串是否可以修改.
104+
99105

100106
另一种思路的解法
101107

@@ -116,6 +122,9 @@ public:
116122
};
117123
```
118124
125+
* 时间复杂度: O(n)
126+
* 空间复杂度: O(1)
127+
119128
120129
121130
## 其他语言版本

0 commit comments

Comments
 (0)