提交 630dcc64 创建 作者: 宋海霞's avatar 宋海霞

modify

上级 8efe800c
...@@ -3,32 +3,32 @@ ...@@ -3,32 +3,32 @@
// //
// 在此处包含 C 标准库头文件 // Include the C standard library header file here
// //
// //
// 在此处包含其他头文件 // Other header files are included here
// //
// //
// 在此处定义数据结构 // Define the data structure here
// //
#define MAX_STACK_LENGTH 64 // 栈的最大长度 #define MAX_STACK_LENGTH 64 // Maximum length of stack
// // Stack
typedef struct Stack{ typedef struct Stack{
int buffer[MAX_STACK_LENGTH]; // 栈的缓冲区 int buffer[MAX_STACK_LENGTH]; // Stack buffer
int top; // 指示栈顶的位置,而不是栈中元素的个数 int top; // Indicates the position at the top of the stack, not the number of elements in the stack
}Stack; }Stack;
// //
// 在此处声明函数 // Declare the function here
// //
void InitStack(Stack* pS); void InitStack(Stack* pS);
...@@ -38,7 +38,7 @@ int StackEmpty(Stack* pS); ...@@ -38,7 +38,7 @@ int StackEmpty(Stack* pS);
// //
// 在此处声明全局变量 // Declare global variables here
// //
......
...@@ -3,14 +3,14 @@ ...@@ -3,14 +3,14 @@
// //
// 在此处包含 C 标准库头文件 // Include the C standard library header file here
// //
#include <stdio.h> #include <stdio.h>
// //
// 在此处包含其他头文件 // Other header files are included here
// //
...@@ -18,33 +18,33 @@ ...@@ -18,33 +18,33 @@
// //
// 在此处定义数据结构 // Define the data structure here
// //
#define MAX_VERTEX_NUM 50 // 顶点最大数量 #define MAX_VERTEX_NUM 50 // Maximum number of vertices
// 边(弧) // Edge (arc)
typedef struct EdgeNode { typedef struct EdgeNode {
int vertex; // 顶点域。即顶点在顶点数组中的下标。 int vertex; // Vertex field. That is, the index of the vertex in the vertex array.
struct EdgeNode* nextedge; // 链域。指向下一条边(弧)。 struct EdgeNode* nextedge; // Chain domain. Point to the next Edge (arc).
}EdgeNode, *PEdgeList; }EdgeNode, *PEdgeList;
// 顶点 // vertex
typedef struct VexNode { typedef struct VexNode {
const char* name; // 使用一个字符串作为顶点保存的值。也可以认为是顶点的名字。 const char* name; // Use a string as the vertex's stored value. You can also think of it as the vertex's name.
PEdgeList firstarc; // 指向第一条边(弧)。 PEdgeList firstarc; // Pointing to the first side arc.
int Indegree; // 顶点的入度。 int Indegree; // indegree of vertex.
}VexNode; }VexNode;
// 图。使用邻接表存储 // Graph. Use adjacency list storage
typedef struct GraphList { typedef struct GraphList {
VexNode vexlist[MAX_VERTEX_NUM]; // 顶点表 VexNode vexlist[MAX_VERTEX_NUM]; // Vertex table
int length; // 顶点数量 int length; // Vertex number
}GraphList; }GraphList;
// //
// 在此处声明函数 // Declare the function here
// //
void InitGraph(GraphList* pGraphList); void InitGraph(GraphList* pGraphList);
...@@ -54,7 +54,7 @@ void DeleteGraph(GraphList* pGraphList); ...@@ -54,7 +54,7 @@ void DeleteGraph(GraphList* pGraphList);
void OutputSortResult(GraphList *pGraphList); void OutputSortResult(GraphList *pGraphList);
// //
// 在此处声明全局变量 // Declare global variables here
// //
extern Stack stack; extern Stack stack;
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论