Squash the language code blocks and fix list.md (#865)

This commit is contained in:
Yudong Jin
2023-10-16 12:06:00 -05:00
committed by GitHub
parent 346c8451de
commit faa44fecd2
52 changed files with 409 additions and 10482 deletions

View File

@ -36,77 +36,9 @@
![冒泡排序流程](bubble_sort.assets/bubble_sort_overview.png)
=== "Python"
```python title="bubble_sort.py"
[class]{}-[func]{bubble_sort}
```
=== "C++"
```cpp title="bubble_sort.cpp"
[class]{}-[func]{bubbleSort}
```
=== "Java"
```java title="bubble_sort.java"
[class]{bubble_sort}-[func]{bubbleSort}
```
=== "C#"
```csharp title="bubble_sort.cs"
[class]{bubble_sort}-[func]{BubbleSort}
```
=== "Go"
```go title="bubble_sort.go"
[class]{}-[func]{bubbleSort}
```
=== "Swift"
```swift title="bubble_sort.swift"
[class]{}-[func]{bubbleSort}
```
=== "JS"
```javascript title="bubble_sort.js"
[class]{}-[func]{bubbleSort}
```
=== "TS"
```typescript title="bubble_sort.ts"
[class]{}-[func]{bubbleSort}
```
=== "Dart"
```dart title="bubble_sort.dart"
[class]{}-[func]{bubbleSort}
```
=== "Rust"
```rust title="bubble_sort.rs"
[class]{}-[func]{bubble_sort}
```
=== "C"
```c title="bubble_sort.c"
[class]{}-[func]{bubbleSort}
```
=== "Zig"
```zig title="bubble_sort.zig"
[class]{}-[func]{bubbleSort}
```
```src
[file]{bubble_sort}-[class]{}-[func]{bubble_sort}
```
## 效率优化
@ -114,77 +46,9 @@
经过优化,冒泡排序的最差和平均时间复杂度仍为 $O(n^2)$ ;但当输入数组完全有序时,可达到最佳时间复杂度 $O(n)$ 。
=== "Python"
```python title="bubble_sort.py"
[class]{}-[func]{bubble_sort_with_flag}
```
=== "C++"
```cpp title="bubble_sort.cpp"
[class]{}-[func]{bubbleSortWithFlag}
```
=== "Java"
```java title="bubble_sort.java"
[class]{bubble_sort}-[func]{bubbleSortWithFlag}
```
=== "C#"
```csharp title="bubble_sort.cs"
[class]{bubble_sort}-[func]{BubbleSortWithFlag}
```
=== "Go"
```go title="bubble_sort.go"
[class]{}-[func]{bubbleSortWithFlag}
```
=== "Swift"
```swift title="bubble_sort.swift"
[class]{}-[func]{bubbleSortWithFlag}
```
=== "JS"
```javascript title="bubble_sort.js"
[class]{}-[func]{bubbleSortWithFlag}
```
=== "TS"
```typescript title="bubble_sort.ts"
[class]{}-[func]{bubbleSortWithFlag}
```
=== "Dart"
```dart title="bubble_sort.dart"
[class]{}-[func]{bubbleSortWithFlag}
```
=== "Rust"
```rust title="bubble_sort.rs"
[class]{}-[func]{bubble_sort_with_flag}
```
=== "C"
```c title="bubble_sort.c"
[class]{}-[func]{bubbleSortWithFlag}
```
=== "Zig"
```zig title="bubble_sort.zig"
[class]{}-[func]{bubbleSortWithFlag}
```
```src
[file]{bubble_sort}-[class]{}-[func]{bubble_sort_with_flag}
```
## 算法特性

View File

@ -14,77 +14,9 @@
![桶排序算法流程](bucket_sort.assets/bucket_sort_overview.png)
=== "Python"
```python title="bucket_sort.py"
[class]{}-[func]{bucket_sort}
```
=== "C++"
```cpp title="bucket_sort.cpp"
[class]{}-[func]{bucketSort}
```
=== "Java"
```java title="bucket_sort.java"
[class]{bucket_sort}-[func]{bucketSort}
```
=== "C#"
```csharp title="bucket_sort.cs"
[class]{bucket_sort}-[func]{BucketSort}
```
=== "Go"
```go title="bucket_sort.go"
[class]{}-[func]{bucketSort}
```
=== "Swift"
```swift title="bucket_sort.swift"
[class]{}-[func]{bucketSort}
```
=== "JS"
```javascript title="bucket_sort.js"
[class]{}-[func]{bucketSort}
```
=== "TS"
```typescript title="bucket_sort.ts"
[class]{}-[func]{bucketSort}
```
=== "Dart"
```dart title="bucket_sort.dart"
[class]{}-[func]{bucketSort}
```
=== "Rust"
```rust title="bucket_sort.rs"
[class]{}-[func]{bucket_sort}
```
=== "C"
```c title="bucket_sort.c"
[class]{}-[func]{bucketSort}
```
=== "Zig"
```zig title="bucket_sort.zig"
[class]{}-[func]{bucketSort}
```
```src
[file]{bucket_sort}-[class]{}-[func]{bucket_sort}
```
## 算法特性

View File

@ -12,77 +12,9 @@
![计数排序流程](counting_sort.assets/counting_sort_overview.png)
=== "Python"
```python title="counting_sort.py"
[class]{}-[func]{counting_sort_naive}
```
=== "C++"
```cpp title="counting_sort.cpp"
[class]{}-[func]{countingSortNaive}
```
=== "Java"
```java title="counting_sort.java"
[class]{counting_sort}-[func]{countingSortNaive}
```
=== "C#"
```csharp title="counting_sort.cs"
[class]{counting_sort}-[func]{CountingSortNaive}
```
=== "Go"
```go title="counting_sort.go"
[class]{}-[func]{countingSortNaive}
```
=== "Swift"
```swift title="counting_sort.swift"
[class]{}-[func]{countingSortNaive}
```
=== "JS"
```javascript title="counting_sort.js"
[class]{}-[func]{countingSortNaive}
```
=== "TS"
```typescript title="counting_sort.ts"
[class]{}-[func]{countingSortNaive}
```
=== "Dart"
```dart title="counting_sort.dart"
[class]{}-[func]{countingSortNaive}
```
=== "Rust"
```rust title="counting_sort.rs"
[class]{}-[func]{counting_sort_naive}
```
=== "C"
```c title="counting_sort.c"
[class]{}-[func]{countingSortNaive}
```
=== "Zig"
```zig title="counting_sort.zig"
[class]{}-[func]{countingSortNaive}
```
```src
[file]{counting_sort}-[class]{}-[func]{counting_sort_naive}
```
!!! note "计数排序与桶排序的联系"
@ -131,77 +63,9 @@ $$
计数排序的实现代码如下所示。
=== "Python"
```python title="counting_sort.py"
[class]{}-[func]{counting_sort}
```
=== "C++"
```cpp title="counting_sort.cpp"
[class]{}-[func]{countingSort}
```
=== "Java"
```java title="counting_sort.java"
[class]{counting_sort}-[func]{countingSort}
```
=== "C#"
```csharp title="counting_sort.cs"
[class]{counting_sort}-[func]{CountingSort}
```
=== "Go"
```go title="counting_sort.go"
[class]{}-[func]{countingSort}
```
=== "Swift"
```swift title="counting_sort.swift"
[class]{}-[func]{countingSort}
```
=== "JS"
```javascript title="counting_sort.js"
[class]{}-[func]{countingSort}
```
=== "TS"
```typescript title="counting_sort.ts"
[class]{}-[func]{countingSort}
```
=== "Dart"
```dart title="counting_sort.dart"
[class]{}-[func]{countingSort}
```
=== "Rust"
```rust title="counting_sort.rs"
[class]{}-[func]{counting_sort}
```
=== "C"
```c title="counting_sort.c"
[class]{}-[func]{countingSort}
```
=== "Zig"
```zig title="counting_sort.zig"
[class]{}-[func]{countingSort}
```
```src
[file]{counting_sort}-[class]{}-[func]{counting_sort}
```
## 算法特性

View File

@ -62,101 +62,9 @@
在代码实现中,我们使用了与堆章节相同的从顶至底堆化 `sift_down()` 函数。值得注意的是,由于堆的长度会随着提取最大元素而减小,因此我们需要给 `sift_down()` 函数添加一个长度参数 $n$ ,用于指定堆的当前有效长度。
=== "Python"
```python title="heap_sort.py"
[class]{}-[func]{sift_down}
[class]{}-[func]{heap_sort}
```
=== "C++"
```cpp title="heap_sort.cpp"
[class]{}-[func]{siftDown}
[class]{}-[func]{heapSort}
```
=== "Java"
```java title="heap_sort.java"
[class]{heap_sort}-[func]{siftDown}
[class]{heap_sort}-[func]{heapSort}
```
=== "C#"
```csharp title="heap_sort.cs"
[class]{heap_sort}-[func]{SiftDown}
[class]{heap_sort}-[func]{HeapSort}
```
=== "Go"
```go title="heap_sort.go"
[class]{}-[func]{siftDown}
[class]{}-[func]{heapSort}
```
=== "Swift"
```swift title="heap_sort.swift"
[class]{}-[func]{siftDown}
[class]{}-[func]{heapSort}
```
=== "JS"
```javascript title="heap_sort.js"
[class]{}-[func]{siftDown}
[class]{}-[func]{heapSort}
```
=== "TS"
```typescript title="heap_sort.ts"
[class]{}-[func]{siftDown}
[class]{}-[func]{heapSort}
```
=== "Dart"
```dart title="heap_sort.dart"
[class]{}-[func]{siftDown}
[class]{}-[func]{heapSort}
```
=== "Rust"
```rust title="heap_sort.rs"
[class]{}-[func]{sift_down}
[class]{}-[func]{heap_sort}
```
=== "C"
```c title="heap_sort.c"
[class]{}-[func]{siftDown}
[class]{}-[func]{heapSort}
```
=== "Zig"
```zig title="heap_sort.zig"
[class]{}-[func]{siftDown}
[class]{}-[func]{heapSort}
```
```src
[file]{heap_sort}-[class]{}-[func]{heap_sort}
```
## 算法特性

View File

@ -19,77 +19,9 @@
![插入排序流程](insertion_sort.assets/insertion_sort_overview.png)
=== "Python"
```python title="insertion_sort.py"
[class]{}-[func]{insertion_sort}
```
=== "C++"
```cpp title="insertion_sort.cpp"
[class]{}-[func]{insertionSort}
```
=== "Java"
```java title="insertion_sort.java"
[class]{insertion_sort}-[func]{insertionSort}
```
=== "C#"
```csharp title="insertion_sort.cs"
[class]{insertion_sort}-[func]{InsertionSort}
```
=== "Go"
```go title="insertion_sort.go"
[class]{}-[func]{insertionSort}
```
=== "Swift"
```swift title="insertion_sort.swift"
[class]{}-[func]{insertionSort}
```
=== "JS"
```javascript title="insertion_sort.js"
[class]{}-[func]{insertionSort}
```
=== "TS"
```typescript title="insertion_sort.ts"
[class]{}-[func]{insertionSort}
```
=== "Dart"
```dart title="insertion_sort.dart"
[class]{}-[func]{insertionSort}
```
=== "Rust"
```rust title="insertion_sort.rs"
[class]{}-[func]{insertion_sort}
```
=== "C"
```c title="insertion_sort.c"
[class]{}-[func]{insertionSort}
```
=== "Zig"
```zig title="insertion_sort.zig"
[class]{}-[func]{insertionSort}
```
```src
[file]{insertion_sort}-[class]{}-[func]{insertion_sort}
```
## 算法特性

View File

@ -51,101 +51,9 @@
- **后序遍历**:先递归左子树,再递归右子树,最后处理根节点。
- **归并排序**:先递归左子数组,再递归右子数组,最后处理合并。
=== "Python"
```python title="merge_sort.py"
[class]{}-[func]{merge}
[class]{}-[func]{merge_sort}
```
=== "C++"
```cpp title="merge_sort.cpp"
[class]{}-[func]{merge}
[class]{}-[func]{mergeSort}
```
=== "Java"
```java title="merge_sort.java"
[class]{merge_sort}-[func]{merge}
[class]{merge_sort}-[func]{mergeSort}
```
=== "C#"
```csharp title="merge_sort.cs"
[class]{merge_sort}-[func]{Merge}
[class]{merge_sort}-[func]{MergeSort}
```
=== "Go"
```go title="merge_sort.go"
[class]{}-[func]{merge}
[class]{}-[func]{mergeSort}
```
=== "Swift"
```swift title="merge_sort.swift"
[class]{}-[func]{merge}
[class]{}-[func]{mergeSort}
```
=== "JS"
```javascript title="merge_sort.js"
[class]{}-[func]{merge}
[class]{}-[func]{mergeSort}
```
=== "TS"
```typescript title="merge_sort.ts"
[class]{}-[func]{merge}
[class]{}-[func]{mergeSort}
```
=== "Dart"
```dart title="merge_sort.dart"
[class]{}-[func]{merge}
[class]{}-[func]{mergeSort}
```
=== "Rust"
```rust title="merge_sort.rs"
[class]{}-[func]{merge}
[class]{}-[func]{merge_sort}
```
=== "C"
```c title="merge_sort.c"
[class]{}-[func]{merge}
[class]{}-[func]{mergeSort}
```
=== "Zig"
```zig title="merge_sort.zig"
[class]{}-[func]{merge}
[class]{}-[func]{mergeSort}
```
```src
[file]{merge_sort}-[class]{}-[func]{merge_sort}
```
实现合并函数 `merge()` 存在以下难点。

View File

@ -41,95 +41,9 @@
哨兵划分的实质是将一个较长数组的排序问题简化为两个较短数组的排序问题。
=== "Python"
```python title="quick_sort.py"
[class]{QuickSort}-[func]{partition}
```
=== "C++"
```cpp title="quick_sort.cpp"
[class]{QuickSort}-[func]{swap}
[class]{QuickSort}-[func]{partition}
```
=== "Java"
```java title="quick_sort.java"
[class]{QuickSort}-[func]{swap}
[class]{QuickSort}-[func]{partition}
```
=== "C#"
```csharp title="quick_sort.cs"
[class]{quickSort}-[func]{Swap}
[class]{quickSort}-[func]{Partition}
```
=== "Go"
```go title="quick_sort.go"
[class]{quickSort}-[func]{partition}
```
=== "Swift"
```swift title="quick_sort.swift"
[class]{}-[func]{swap}
[class]{}-[func]{partition}
```
=== "JS"
```javascript title="quick_sort.js"
[class]{QuickSort}-[func]{swap}
[class]{QuickSort}-[func]{partition}
```
=== "TS"
```typescript title="quick_sort.ts"
[class]{QuickSort}-[func]{swap}
[class]{QuickSort}-[func]{partition}
```
=== "Dart"
```dart title="quick_sort.dart"
[class]{QuickSort}-[func]{_swap}
[class]{QuickSort}-[func]{_partition}
```
=== "Rust"
```rust title="quick_sort.rs"
[class]{QuickSort}-[func]{partition}
```
=== "C"
```c title="quick_sort.c"
[class]{}-[func]{swap}
[class]{}-[func]{partition}
```
=== "Zig"
```zig title="quick_sort.zig"
[class]{QuickSort}-[func]{swap}
[class]{QuickSort}-[func]{partition}
```
```src
[file]{quick_sort}-[class]{quick_sort}-[func]{partition}
```
## 算法流程
@ -141,77 +55,9 @@
![快速排序流程](quick_sort.assets/quick_sort_overview.png)
=== "Python"
```python title="quick_sort.py"
[class]{QuickSort}-[func]{quick_sort}
```
=== "C++"
```cpp title="quick_sort.cpp"
[class]{QuickSort}-[func]{quickSort}
```
=== "Java"
```java title="quick_sort.java"
[class]{QuickSort}-[func]{quickSort}
```
=== "C#"
```csharp title="quick_sort.cs"
[class]{quickSort}-[func]{QuickSort}
```
=== "Go"
```go title="quick_sort.go"
[class]{quickSort}-[func]{quickSort}
```
=== "Swift"
```swift title="quick_sort.swift"
[class]{}-[func]{quickSort}
```
=== "JS"
```javascript title="quick_sort.js"
[class]{QuickSort}-[func]{quickSort}
```
=== "TS"
```typescript title="quick_sort.ts"
[class]{QuickSort}-[func]{quickSort}
```
=== "Dart"
```dart title="quick_sort.dart"
[class]{QuickSort}-[func]{quickSort}
```
=== "Rust"
```rust title="quick_sort.rs"
[class]{QuickSort}-[func]{quick_sort}
```
=== "C"
```c title="quick_sort.c"
[class]{}-[func]{quickSort}
```
=== "Zig"
```zig title="quick_sort.zig"
[class]{QuickSort}-[func]{quickSort}
```
```src
[file]{quick_sort}-[class]{quick_sort}-[func]{quick_sort}
```
## 算法特性
@ -237,101 +83,9 @@
为了进一步改进,我们可以在数组中选取三个候选元素(通常为数组的首、尾、中点元素),**并将这三个候选元素的中位数作为基准数**。这样一来,基准数“既不太小也不太大”的概率将大幅提升。当然,我们还可以选取更多候选元素,以进一步提高算法的稳健性。采用这种方法后,时间复杂度劣化至 $O(n^2)$ 的概率大大降低。
=== "Python"
```python title="quick_sort.py"
[class]{QuickSortMedian}-[func]{median_three}
[class]{QuickSortMedian}-[func]{partition}
```
=== "C++"
```cpp title="quick_sort.cpp"
[class]{QuickSortMedian}-[func]{medianThree}
[class]{QuickSortMedian}-[func]{partition}
```
=== "Java"
```java title="quick_sort.java"
[class]{QuickSortMedian}-[func]{medianThree}
[class]{QuickSortMedian}-[func]{partition}
```
=== "C#"
```csharp title="quick_sort.cs"
[class]{QuickSortMedian}-[func]{MedianThree}
[class]{QuickSortMedian}-[func]{Partition}
```
=== "Go"
```go title="quick_sort.go"
[class]{quickSortMedian}-[func]{medianThree}
[class]{quickSortMedian}-[func]{partition}
```
=== "Swift"
```swift title="quick_sort.swift"
[class]{}-[func]{medianThree}
[class]{}-[func]{partitionMedian}
```
=== "JS"
```javascript title="quick_sort.js"
[class]{QuickSortMedian}-[func]{medianThree}
[class]{QuickSortMedian}-[func]{partition}
```
=== "TS"
```typescript title="quick_sort.ts"
[class]{QuickSortMedian}-[func]{medianThree}
[class]{QuickSortMedian}-[func]{partition}
```
=== "Dart"
```dart title="quick_sort.dart"
[class]{QuickSortMedian}-[func]{_medianThree}
[class]{QuickSortMedian}-[func]{_partition}
```
=== "Rust"
```rust title="quick_sort.rs"
[class]{QuickSortMedian}-[func]{median_three}
[class]{QuickSortMedian}-[func]{partition}
```
=== "C"
```c title="quick_sort.c"
[class]{}-[func]{medianThree}
[class]{}-[func]{partitionMedian}
```
=== "Zig"
```zig title="quick_sort.zig"
[class]{QuickSortMedian}-[func]{medianThree}
[class]{QuickSortMedian}-[func]{partition}
```
```src
[file]{quick_sort}-[class]{quick_sort_median}-[func]{partition}
```
## 尾递归优化
@ -339,74 +93,6 @@
为了防止栈帧空间的累积,我们可以在每轮哨兵排序完成后,比较两个子数组的长度,**仅对较短的子数组进行递归**。由于较短子数组的长度不会超过 $n / 2$ ,因此这种方法能确保递归深度不超过 $\log n$ ,从而将最差空间复杂度优化至 $O(\log n)$ 。
=== "Python"
```python title="quick_sort.py"
[class]{QuickSortTailCall}-[func]{quick_sort}
```
=== "C++"
```cpp title="quick_sort.cpp"
[class]{QuickSortTailCall}-[func]{quickSort}
```
=== "Java"
```java title="quick_sort.java"
[class]{QuickSortTailCall}-[func]{quickSort}
```
=== "C#"
```csharp title="quick_sort.cs"
[class]{QuickSortTailCall}-[func]{QuickSort}
```
=== "Go"
```go title="quick_sort.go"
[class]{quickSortTailCall}-[func]{quickSort}
```
=== "Swift"
```swift title="quick_sort.swift"
[class]{}-[func]{quickSortTailCall}
```
=== "JS"
```javascript title="quick_sort.js"
[class]{QuickSortTailCall}-[func]{quickSort}
```
=== "TS"
```typescript title="quick_sort.ts"
[class]{QuickSortTailCall}-[func]{quickSort}
```
=== "Dart"
```dart title="quick_sort.dart"
[class]{QuickSortTailCall}-[func]{quickSort}
```
=== "Rust"
```rust title="quick_sort.rs"
[class]{QuickSortTailCall}-[func]{quick_sort}
```
=== "C"
```c title="quick_sort.c"
[class]{}-[func]{quickSortTailCall}
```
=== "Zig"
```zig title="quick_sort.zig"
[class]{QuickSortTailCall}-[func]{quickSort}
```
```src
[file]{quick_sort}-[class]{quick_sort_tail_call}-[func]{quick_sort}
```

View File

@ -24,125 +24,9 @@ $$
此外,我们需要小幅改动计数排序代码,使之可以根据数字的第 $k$ 位进行排序。
=== "Python"
```python title="radix_sort.py"
[class]{}-[func]{digit}
[class]{}-[func]{counting_sort_digit}
[class]{}-[func]{radix_sort}
```
=== "C++"
```cpp title="radix_sort.cpp"
[class]{}-[func]{digit}
[class]{}-[func]{countingSortDigit}
[class]{}-[func]{radixSort}
```
=== "Java"
```java title="radix_sort.java"
[class]{radix_sort}-[func]{digit}
[class]{radix_sort}-[func]{countingSortDigit}
[class]{radix_sort}-[func]{radixSort}
```
=== "C#"
```csharp title="radix_sort.cs"
[class]{radix_sort}-[func]{Digit}
[class]{radix_sort}-[func]{CountingSortDigit}
[class]{radix_sort}-[func]{RadixSort}
```
=== "Go"
```go title="radix_sort.go"
[class]{}-[func]{digit}
[class]{}-[func]{countingSortDigit}
[class]{}-[func]{radixSort}
```
=== "Swift"
```swift title="radix_sort.swift"
[class]{}-[func]{digit}
[class]{}-[func]{countingSortDigit}
[class]{}-[func]{radixSort}
```
=== "JS"
```javascript title="radix_sort.js"
[class]{}-[func]{digit}
[class]{}-[func]{countingSortDigit}
[class]{}-[func]{radixSort}
```
=== "TS"
```typescript title="radix_sort.ts"
[class]{}-[func]{digit}
[class]{}-[func]{countingSortDigit}
[class]{}-[func]{radixSort}
```
=== "Dart"
```dart title="radix_sort.dart"
[class]{}-[func]{digit}
[class]{}-[func]{countingSortDigit}
[class]{}-[func]{radixSort}
```
=== "Rust"
```rust title="radix_sort.rs"
[class]{}-[func]{digit}
[class]{}-[func]{counting_sort_digit}
[class]{}-[func]{radix_sort}
```
=== "C"
```c title="radix_sort.c"
[class]{}-[func]{digit}
[class]{}-[func]{countingSortDigit}
[class]{}-[func]{radixSort}
```
=== "Zig"
```zig title="radix_sort.zig"
[class]{}-[func]{digit}
[class]{}-[func]{countingSortDigit}
[class]{}-[func]{radixSort}
```
```src
[file]{radix_sort}-[class]{}-[func]{radix_sort}
```
!!! question "为什么从最低位开始排序?"

View File

@ -45,77 +45,9 @@
在代码中,我们用 $k$ 来记录未排序区间内的最小元素。
=== "Python"
```python title="selection_sort.py"
[class]{}-[func]{selection_sort}
```
=== "C++"
```cpp title="selection_sort.cpp"
[class]{}-[func]{selectionSort}
```
=== "Java"
```java title="selection_sort.java"
[class]{selection_sort}-[func]{selectionSort}
```
=== "C#"
```csharp title="selection_sort.cs"
[class]{selection_sort}-[func]{SelectionSort}
```
=== "Go"
```go title="selection_sort.go"
[class]{}-[func]{selectionSort}
```
=== "Swift"
```swift title="selection_sort.swift"
[class]{}-[func]{selectionSort}
```
=== "JS"
```javascript title="selection_sort.js"
[class]{}-[func]{selectionSort}
```
=== "TS"
```typescript title="selection_sort.ts"
[class]{}-[func]{selectionSort}
```
=== "Dart"
```dart title="selection_sort.dart"
[class]{}-[func]{selectionSort}
```
=== "Rust"
```rust title="selection_sort.rs"
[class]{}-[func]{selection_sort}
```
=== "C"
```c title="selection_sort.c"
[class]{}-[func]{selectionSort}
```
=== "Zig"
```zig title="selection_sort.zig"
[class]{}-[func]{selectionSort}
```
```src
[file]{selection_sort}-[class]{}-[func]{selection_sort}
```
## 算法特性