c语言 数据结构与算法百度云,【资料分享】 数据结构与算法全集(C源代码+详细注释)!...

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼

│ │ BiTree.cpp

│ │ BiTree.h

│ │ LinkQueue.cpp

│ │ LinkQueue.h

│ │ main.cpp

│ │ QElemType.h

│ │ Status.h

│ │ TElmeType.h

│ │

│ ├—二叉树的顺序存储结构

│ │ main.cpp

│ │ SqBiTree.cpp

│ │ SqBiTree.h

│ │ Status.h

│ │ TELemType_define.cpp

│ │

│ ├—哈夫曼树和哈夫曼编码

│ │ HuffmanTree.cpp

│ │ HuffmanTree.h

│ │ main.cpp

│ │ Status.h

│ │

│ ├—最小生成树

│ │ 1.txt

│ │ InfoType.cpp

│ │ InfoType.h

│ │ Main.cpp

│ │ MGraph.cpp

│ │ MGraph.h

│ │ MiniSpanTree_Kruskal.cpp

│ │ MiniSpanTree_Kruskal.h

│ │ MiniSpanTree_PRIM.cpp

│ │ MiniSpanTree_PRIM.h

│ │ Status.h

│ │ VertexType.cpp

│ │ VertexType.h

│ │

│ ├—树的二叉链表

│ │ CSTree.cpp

│ │ CSTree.h

│ │ LinkQueue.cpp

│ │ LinkQueue.h

│ │ main.cpp

│ │ QElemType.h

│ │ Status.h

│ │ TElmeType.h

│ │

│ ├—深度优先生成森林(无向图的连通性和生成树)

│ │ ALGraph.cpp

│ │ ALGraph.h

│ │ CSTree.cpp

│ │ CSTree.h

│ │ DFSForest.cpp

│ │ DFSForest.h

│ │ InfoType.cpp

│ │ InfoType.h

│ │ LinkList.cpp

│ │ LinkQueue.cpp

│ │ LinkQueue.h

│ │ Main.cpp

│ │ QElemType.h

│ │ Status.h

│ │ TElmeType.h

│ │ VertexType.cpp

│ │ VertexType.h

│ │

│ └—线索二叉树

│ BiThrTree.cpp

│ BiThrTree.h

│ main.cpp

│ Status.h

│ TElmeType.h

└—表和数组

├—KMP算法

│ Basic_operation_functions.h

│ def_SString.h

│ KMP.h

│ main.cpp

│ Status.h

├—n阶对称矩阵的压缩存储

│ Basic_operation_functions.h

│ mian.cpp

│ Status.h

│ struct SyMatrix.h

├—三元组稀疏矩阵的压缩存储

│ Basic_operation_functions.h

│ B_opera_fun_called_fun.h

│ main.cpp

│ Status.h

│ struct TSMatrix.h

│ Universal_main.h

│ Universa_ts_b_opera_fun.h

├—不设头结点的单链表

│ LinkList.cpp

│ LinkList.h

│ main.cpp

│ Status.h

├—串的堆存储结构

│ Basic_operation_functions.h

│ HString.h

│ Line_List.h

│ main.cpp

│ Status.h

├—串的定长顺序存储结构

│ Basic_operation_functions.h

│ def_SString.h

│ Main.cpp

│ Status.h

├—广义表

│ GList.cpp

│ GList.h

│ main.cpp

│ SString.cpp

│ SString.h

│ Status.h

├—数组

│ Basic_operation_functions.h

│ main.cpp

│ Status.h

│ struct array.h

├—文本编辑(串和行表操作)

│ Basic_operation_functions.h

│ HString.h

│ Line_List.h

│ main.cpp

│ Status.h

├—栈的顺序存储结构

│ main.cpp

│ SqStack.cpp

│ SqStack.h

│ Status.h

├—走迷宫

│ Basic_called_functions.h

│ Basic_operation_functions.h

│ Main_Maze.cpp

│ Status.h

│ struct SqStack.h

└—链队列

Basic_called_functions.cpp

Basic_called_functions.h

Basic_operation_functions.cpp

main.cpp

QElemType.h

Status.h

Struct_LinkQueue.h

数组的插入:   #include   #define SIZE 10   int main()   {   int a[SIZE]={10,12,14,16,18,20,13,200,134,59}; /* 初始化数组 */   int b[SIZE+1]={0},i,j,x,v; /* b数组为插入后的数组,新插入了一个元素,所以要在原数组的基础上加1 */   printf(\"Please input insert addr:\");   scanf(\"%d\",&x); /* 插入值的位置 */   printf(\"Please input insert value:\");   scanf(\"%d\",&v); /* 插入值 */   for (i=0;ix) b[i+1]=a[i]; /* 当循环中的i大于插入值的位置x时,以后每一个元素所放的位置向后退一   格 */   if (i<x) b[i]=a[i]; /* 当循环中的i小于插入值的位置x时,每一个元素所放的位置不变 */   }   printf(\"This array is:n\");   for (j=0;j<=SIZE;j++)   printf(\"]\",b[j]); /* 打印数组 */   printf(\"n\");   return 0;   }   数组的删除:   #include   #define SIZE 10   int main()   {   int a[SIZE]={10,12,14,16,18,20,13,200,134,59};   int b[SIZE-1]={0},i,j,x,v;   printf(\"Please input insert addr:\");   scanf(\"%d\",&x);   for (i=0;ix) b[i-1]=a[i];   if (i<x) b[i]=a[i];   }   printf(\"This array is:n\");   for (j=0;j<=SIZE-2;j++)   printf(\"]\",b[j]);   printf(\"n\");   return 0;   }   数组的插入跟数组删除大体上差不多,当插入元素后,插入点后面的每一个元素向后移一个位置,而删除是向前移一个位置。   数组的排序(泡沫排序法):   /* 本程序把数组的值按升排列 */   #include   #define SIZE 15   main()   {   int a[SIZE]={900,2,3,58,34,76,32,43,56,70,35,234,532,543,2500};   int i,pass,hold,j=0,k=0;   printf(\"Data items in oraginal ordern\");   for (i=0;i<=SIZE-1;i++) /* 打印排序前的数组 */   printf(\"m\",a[i]);   for (pass=1;pass<=SIZE-1;pass++) { /* 比较的趟数 */   for (i=0;ia[i+1]) {   hold=a[i];   a[i]=a[i+1];   a[i+1]=hold;   }   }   }   printf(\"nData items in ascending ordern\");   for (i=0;i<=SIZE-1;i++) /* 打印排序后的数组 */   printf(\"m\",a[i]);   printf(\"n\");   return 0;   }   Come on!
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值