mirror of
https://github.com/krahets/hello-algo.git
synced 2025-11-04 22:28:40 +08:00
Update space_complexity.md
Fix the Go code.
This commit is contained in:
@ -223,7 +223,7 @@ comments: true
|
|||||||
b := make([]int, 10000) // O(1)
|
b := make([]int, 10000) // O(1)
|
||||||
var nums []int
|
var nums []int
|
||||||
if n > 10 {
|
if n > 10 {
|
||||||
nums = make([]int, 10000) // O(n)
|
nums := make([]int, n) // O(n)
|
||||||
}
|
}
|
||||||
fmt.Println(a, b, nums)
|
fmt.Println(a, b, nums)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user