mirror of
https://github.com/krahets/hello-algo.git
synced 2025-02-02 14:18:47 +08:00
Update space_complexity.md (#631)
* Update space_complexity.md 修改一个C语言的函数,c语言中错误使用C++的STL库的vector类,现在更正为直接使用定义数组去申请内存 * Update space_complexity.md --------- Co-authored-by: Yudong Jin <krahets@163.com>
This commit is contained in:
parent
2af77ff565
commit
30d1d36dd7
@ -369,7 +369,7 @@
|
||||
int a = 0; // O(1)
|
||||
int b[10000]; // O(1)
|
||||
if (n > 10)
|
||||
vector<int> nums(n); // O(n)
|
||||
int nums[n] = {0}; // O(n)
|
||||
}
|
||||
```
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user