Several bug fixes and improvements. (#887)

* fix the bugs of C code.

* Add a header figure.

* Improve the definition of tree node height.
This commit is contained in:
Yudong Jin
2023-10-25 22:59:25 +08:00
committed by GitHub
parent 436b6fa9a6
commit d26e811e10
5 changed files with 9 additions and 6 deletions
+2 -2
View File
@@ -224,9 +224,9 @@ void removeVertex(GraphAdjList *graph, unsigned int index) {
// 将顶点前移
for (int i = index; i < graph->size - 1; i++) {
graph->vertices[i] = graph->vertices[i + 1]; // 顶点前移
graph->vertices[i]->pos--; // 所有前移的顶点索引值减1
graph->vertices[i]->pos--; // 所有前移的顶点索引值减 1
}
graph->vertices[graph->size - 1] = 0; // 将被删除顶点的位置置 0
graph->vertices[graph->size - 1] = 0;
graph->size--;
// 释放内存
freeVertex(vet);