mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-08 00:43:04 +08:00
添加复杂度分析
This commit is contained in:
@ -98,6 +98,8 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
// 时间复杂度: 最差情况所有元素都是唯一的。复杂度和全排列1都是 O(n! * n) 对于 n 个元素一共有 n! 中排列方案。而对于每一个答案,我们需要 O(n) 去复制最终放到 result 数组
|
||||
// 空间复杂度: O(n) 回溯树的深度取决于我们有多少个元素
|
||||
```
|
||||
|
||||
## 拓展
|
||||
|
Reference in New Issue
Block a user