docs: 添加仓库地址到README;chore: 整理实验分析;feat: Kruskal最小生成树与图存储结构

This commit is contained in:
2025-12-14 14:06:31 +08:00
parent be03307655
commit f2b8d1fe4c
52 changed files with 4600 additions and 291 deletions
@@ -2,6 +2,9 @@
本目录包含数据结构相关的C语言实现代码,专注于基础数据结构的学习和实践。
## 仓库地址
- GitHub仓库为:https://github.com/LHY0125/Learn_C.git
## 📁 文件列表
### 核心实现
+7 -8
View File
@@ -6,8 +6,7 @@
#include <direct.h>
#endif
typedef int Status; // 函数返回状态
typedef int SElemType; // 栈元素类型
typedef int SElemType; // 栈元素类型,方便自定义栈的数据类型
typedef struct
{
@@ -17,7 +16,7 @@ typedef struct
} DblStack;
// 双栈的初始化
Status Init(DblStack *s, int m)
int Init(DblStack *s, int m)
{
// 容量无效
if (m <= 0)
@@ -56,7 +55,7 @@ void Destroy(DblStack *s)
}
// 判断栈是否为空
Status IsEmpty(DblStack s, int Num)
int IsEmpty(DblStack s, int Num)
{
// 栈号无效
if (Num != 0 && Num != 1)
@@ -91,7 +90,7 @@ Status IsEmpty(DblStack s, int Num)
}
// 判断双栈是否已满
Status IsFull(DblStack s)
int IsFull(DblStack s)
{
// 两栈顶相遇
if (s.top[0] + 1 == s.top[1])
@@ -105,7 +104,7 @@ Status IsFull(DblStack s)
}
// 进栈操作
Status Push(DblStack *s, int Num, SElemType e)
int Push(DblStack *s, int Num, SElemType e)
{
// 栈号无效
if (Num != 0 && Num != 1)
@@ -134,7 +133,7 @@ Status Push(DblStack *s, int Num, SElemType e)
}
// 出栈操作
Status Pop(DblStack *s, int Num, SElemType *e)
int Pop(DblStack *s, int Num, SElemType *e)
{
// 栈号无效
if (Num != 0 && Num != 1)
@@ -163,7 +162,7 @@ Status Pop(DblStack *s, int Num, SElemType *e)
}
// 获取栈顶元素
Status GetTop(DblStack s, int Num, SElemType *e)
int GetTop(DblStack s, int Num, SElemType *e)
{
// 栈号无效
if (Num != 0 && Num != 1)
@@ -0,0 +1,23 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef _WIN32
#include <windows.h>
#include <direct.h>
#endif
int main()
{
// 设置控制台编码为UTF-8,防止中文乱码
#ifdef _WIN32
system("chcp 65001 > nul"); // 设置控制台编码为UTF-8
SetConsoleOutputCP(65001); // 设置控制台输出编码
SetConsoleCP(65001); // 设置控制台输入编码
_mkdir("records");
#endif
return 0;
}