This commit is contained in:
programmercarl
2022-05-22 11:11:50 +08:00
parent 28a8d2ea1c
commit 278011c2df
6 changed files with 20 additions and 60 deletions

View File

@@ -105,8 +105,8 @@ public:
};
```
* 时间复杂度$O(n\log n)$因为有一个快排
* 空间复杂度$O(1)$
* 时间复杂度O(nlog n)因为有一个快排
* 空间复杂度O(1)有一个快排最差情况(倒序)需要n次递归调用因此确实需要O(n)的栈空间
可以看出代码并不复杂