Fix space_complexity.md
This commit is contained in:
parent
b37a088f7d
commit
d09b1e4f9f
@ -87,10 +87,11 @@
|
||||
return 0
|
||||
|
||||
def algorithm(n) -> int: # 输入数据
|
||||
A: int = 0 # 暂存数据(常量,一般用大写字母表示)
|
||||
b: int = 0 # 暂存数据(变量)
|
||||
node = Node(0) # 暂存数据(对象)
|
||||
c: int = function() # 栈帧空间(调用函数)
|
||||
return a + b + c # 输出数据
|
||||
return A + b + c # 输出数据
|
||||
```
|
||||
|
||||
=== "Go"
|
||||
@ -143,7 +144,7 @@
|
||||
|
||||
function algorithm(n) { // 输入数据
|
||||
const a = 0; // 暂存数据(常量)
|
||||
const b = 0; // 暂存数据(变量)
|
||||
let b = 0; // 暂存数据(变量)
|
||||
const node = new Node(0); // 暂存数据(对象)
|
||||
const c = constFunc(); // 栈帧空间(调用函数)
|
||||
return a + b + c; // 输出数据
|
||||
@ -171,7 +172,7 @@
|
||||
|
||||
function algorithm(n: number): number { // 输入数据
|
||||
const a = 0; // 暂存数据(常量)
|
||||
const b = 0; // 暂存数据(变量)
|
||||
let b = 0; // 暂存数据(变量)
|
||||
const node = new Node(0); // 暂存数据(对象)
|
||||
const c = constFunc(); // 栈帧空间(调用函数)
|
||||
return a + b + c; // 输出数据
|
||||
@ -204,7 +205,7 @@
|
||||
|
||||
int algorithm(int n) // 输入数据
|
||||
{
|
||||
int a = 0; // 暂存数据(常量)
|
||||
const int a = 0; // 暂存数据(常量)
|
||||
int b = 0; // 暂存数据(变量)
|
||||
Node node = new Node(0); // 暂存数据(对象)
|
||||
int c = function(); // 栈帧空间(调用函数)
|
||||
|
Loading…
Reference in New Issue
Block a user