mirror of
https://github.com/krahets/hello-algo.git
synced 2026-04-24 10:33:34 +08:00
Remove incomplete zig code from docs. (#1837)
This commit is contained in:
@@ -361,12 +361,6 @@ The related code is as follows:
|
||||
end
|
||||
```
|
||||
|
||||
=== "Zig"
|
||||
|
||||
```zig title=""
|
||||
|
||||
```
|
||||
|
||||
## Calculation Method
|
||||
|
||||
The calculation method for space complexity is roughly the same as for time complexity, except that the statistical object is changed from "number of operations" to "size of space used".
|
||||
@@ -529,12 +523,6 @@ Observe the following code. The "worst case" in worst-case space complexity has
|
||||
end
|
||||
```
|
||||
|
||||
=== "Zig"
|
||||
|
||||
```zig title=""
|
||||
|
||||
```
|
||||
|
||||
**In recursive functions, it is necessary to count the stack frame space**. Observe the following code:
|
||||
|
||||
=== "Python"
|
||||
@@ -807,12 +795,6 @@ Observe the following code. The "worst case" in worst-case space complexity has
|
||||
end
|
||||
```
|
||||
|
||||
=== "Zig"
|
||||
|
||||
```zig title=""
|
||||
|
||||
```
|
||||
|
||||
The time complexity of both functions `loop()` and `recur()` is $O(n)$, but their space complexities are different.
|
||||
|
||||
- The function `loop()` calls `function()` $n$ times in a loop. In each iteration, `function()` returns and releases its stack frame space, so the space complexity remains $O(1)$.
|
||||
|
||||
Reference in New Issue
Block a user