mirror of
https://github.com/krahets/hello-algo.git
synced 2026-07-11 23:16:07 +00:00
build
This commit is contained in:
@@ -1077,6 +1077,14 @@ Note that memory occupied by initializing variables or calling functions in a lo
|
||||
}
|
||||
```
|
||||
|
||||
=== "Ruby"
|
||||
|
||||
```ruby title="space_complexity.rb"
|
||||
[class]{}-[func]{function}
|
||||
|
||||
[class]{}-[func]{constant}
|
||||
```
|
||||
|
||||
=== "Zig"
|
||||
|
||||
```zig title="space_complexity.zig"
|
||||
@@ -1373,6 +1381,12 @@ Linear order is common in arrays, linked lists, stacks, queues, etc., where the
|
||||
}
|
||||
```
|
||||
|
||||
=== "Ruby"
|
||||
|
||||
```ruby title="space_complexity.rb"
|
||||
[class]{}-[func]{linear}
|
||||
```
|
||||
|
||||
=== "Zig"
|
||||
|
||||
```zig title="space_complexity.zig"
|
||||
@@ -1549,6 +1563,12 @@ As shown below, this function's recursive depth is $n$, meaning there are $n$ in
|
||||
}
|
||||
```
|
||||
|
||||
=== "Ruby"
|
||||
|
||||
```ruby title="space_complexity.rb"
|
||||
[class]{}-[func]{linear_recur}
|
||||
```
|
||||
|
||||
=== "Zig"
|
||||
|
||||
```zig title="space_complexity.zig"
|
||||
@@ -1783,6 +1803,12 @@ Quadratic order is common in matrices and graphs, where the number of elements i
|
||||
}
|
||||
```
|
||||
|
||||
=== "Ruby"
|
||||
|
||||
```ruby title="space_complexity.rb"
|
||||
[class]{}-[func]{quadratic}
|
||||
```
|
||||
|
||||
=== "Zig"
|
||||
|
||||
```zig title="space_complexity.zig"
|
||||
@@ -1972,6 +1998,12 @@ As shown below, the recursive depth of this function is $n$, and in each recursi
|
||||
}
|
||||
```
|
||||
|
||||
=== "Ruby"
|
||||
|
||||
```ruby title="space_complexity.rb"
|
||||
[class]{}-[func]{quadratic_recur}
|
||||
```
|
||||
|
||||
=== "Zig"
|
||||
|
||||
```zig title="space_complexity.zig"
|
||||
@@ -2164,6 +2196,12 @@ Exponential order is common in binary trees. Observe the below image, a "full bi
|
||||
}
|
||||
```
|
||||
|
||||
=== "Ruby"
|
||||
|
||||
```ruby title="space_complexity.rb"
|
||||
[class]{}-[func]{build_tree}
|
||||
```
|
||||
|
||||
=== "Zig"
|
||||
|
||||
```zig title="space_complexity.zig"
|
||||
|
||||
Reference in New Issue
Block a user