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

@@ -28,77 +28,9 @@
以下是基于邻接矩阵表示图的实现代码。
=== "Python"
```python title="graph_adjacency_matrix.py"
[class]{GraphAdjMat}-[func]{}
```
=== "C++"
```cpp title="graph_adjacency_matrix.cpp"
[class]{GraphAdjMat}-[func]{}
```
=== "Java"
```java title="graph_adjacency_matrix.java"
[class]{GraphAdjMat}-[func]{}
```
=== "C#"
```csharp title="graph_adjacency_matrix.cs"
[class]{GraphAdjMat}-[func]{}
```
=== "Go"
```go title="graph_adjacency_matrix.go"
[class]{graphAdjMat}-[func]{}
```
=== "Swift"
```swift title="graph_adjacency_matrix.swift"
[class]{GraphAdjMat}-[func]{}
```
=== "JS"
```javascript title="graph_adjacency_matrix.js"
[class]{GraphAdjMat}-[func]{}
```
=== "TS"
```typescript title="graph_adjacency_matrix.ts"
[class]{GraphAdjMat}-[func]{}
```
=== "Dart"
```dart title="graph_adjacency_matrix.dart"
[class]{GraphAdjMat}-[func]{}
```
=== "Rust"
```rust title="graph_adjacency_matrix.rs"
[class]{GraphAdjMat}-[func]{}
```
=== "C"
```c title="graph_adjacency_matrix.c"
[class]{graphAdjMat}-[func]{}
```
=== "Zig"
```zig title="graph_adjacency_matrix.zig"
```
```src
[file]{graph_adjacency_matrix}-[class]{graph_adj_mat}-[func]{}
```
## 基于邻接表的实现
@@ -131,77 +63,9 @@
2. 如果类似邻接矩阵那样,使用顶点列表索引来区分不同顶点。那么,假设我们想要删除索引为 $i$ 的顶点,则需要遍历整个邻接表,将其中 $> i$ 的索引全部减 $1$ ,这样操作效率较低。
3. 因此我们考虑引入顶点类 `Vertex` ,使得每个顶点都是唯一的对象,此时删除顶点时就无须改动其余顶点了。
=== "Python"
```python title="graph_adjacency_list.py"
[class]{GraphAdjList}-[func]{}
```
=== "C++"
```cpp title="graph_adjacency_list.cpp"
[class]{GraphAdjList}-[func]{}
```
=== "Java"
```java title="graph_adjacency_list.java"
[class]{GraphAdjList}-[func]{}
```
=== "C#"
```csharp title="graph_adjacency_list.cs"
[class]{GraphAdjList}-[func]{}
```
=== "Go"
```go title="graph_adjacency_list.go"
[class]{graphAdjList}-[func]{}
```
=== "Swift"
```swift title="graph_adjacency_list.swift"
[class]{GraphAdjList}-[func]{}
```
=== "JS"
```javascript title="graph_adjacency_list.js"
[class]{GraphAdjList}-[func]{}
```
=== "TS"
```typescript title="graph_adjacency_list.ts"
[class]{GraphAdjList}-[func]{}
```
=== "Dart"
```dart title="graph_adjacency_list.dart"
[class]{GraphAdjList}-[func]{}
```
=== "Rust"
```rust title="graph_adjacency_list.rs"
[class]{GraphAdjList}-[func]{}
```
=== "C"
```c title="graph_adjacency_list.c"
[class]{graphAdjList}-[func]{}
```
=== "Zig"
```zig title="graph_adjacency_list.zig"
[class]{GraphAdjList}-[func]{}
```
```src
[file]{graph_adjacency_list}-[class]{graph_adj_list}-[func]{}
```
## 效率对比