Merge pull request #2143 from Logenleedev/master

修改复杂度 - 047 全排列 II
This commit is contained in:
程序员Carl 2023-07-05 13:21:55 +08:00 committed by GitHub
commit 5974c82aea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -101,7 +101,7 @@ public:
// 时间复杂度: 最差情况所有元素都是唯一的。复杂度和全排列1都是 O(n! * n) 对于 n 个元素一共有 n! 中排列方案。而对于每一个答案,我们需要 O(n) 去复制最终放到 result 数组
// 空间复杂度: O(n) 回溯树的深度取决于我们有多少个元素
```
* 时间复杂度: O(n)
* 时间复杂度: O(n! * n)
* 空间复杂度: O(n)
## 拓展