mirror of
https://github.com/krahets/hello-algo.git
synced 2026-07-11 06:56:06 +00:00
Add Zig code blocks.
This commit is contained in:
@@ -194,6 +194,12 @@ comments: true
|
||||
}
|
||||
```
|
||||
|
||||
=== "Zig"
|
||||
|
||||
```zig title="insertion_sort.zig"
|
||||
|
||||
```
|
||||
|
||||
## 11.3.2. 算法特性
|
||||
|
||||
**时间复杂度 $O(n^2)$** :最差情况下,各轮插入操作循环 $n - 1$ , $n-2$ , $\cdots$ , $2$ , $1$ 次,求和为 $\frac{(n - 1) n}{2}$ ,使用 $O(n^2)$ 时间。
|
||||
|
||||
Reference in New Issue
Block a user