update 0541.反转字符串II:添加复杂度分析
This commit is contained in:
parent
62a9b6c372
commit
22ab6281e4
|
|
@ -65,6 +65,9 @@ public:
|
|||
};
|
||||
```
|
||||
|
||||
* 时间复杂度: O(n)
|
||||
* 空间复杂度: O(1)
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -96,6 +99,9 @@ public:
|
|||
};
|
||||
```
|
||||
|
||||
* 时间复杂度: O(n)
|
||||
* 空间复杂度: O(1)或O(n), 取决于使用的语言中字符串是否可以修改.
|
||||
|
||||
|
||||
另一种思路的解法
|
||||
|
||||
|
|
@ -116,6 +122,9 @@ public:
|
|||
};
|
||||
```
|
||||
|
||||
* 时间复杂度: O(n)
|
||||
* 空间复杂度: O(1)
|
||||
|
||||
|
||||
|
||||
## 其他语言版本
|
||||
|
|
|
|||
Loading…
Reference in New Issue