随笔分类 - c++学习
发表于 2022-07-31 11:27阅读次数:81评论次数:0
摘要:1、排序算法(直接插入排序、折半插入排序、2-路插入排序、表排序) #include<stdio.h> #define T int #define MAXSIZE 20 #define MAXVALUE 0x7fffffff typedef T SqList[MAXSIZE]; typedef st
阅读全文 »
发表于 2022-07-31 10:45阅读次数:38评论次数:0
摘要:1、基于图的邻接表下拓扑排序算法的实现 #include<stdio.h> #include<malloc.h> #include<assert.h> #define Default_Vertex_Size 10 #define T char typedef struct Edge { int de
阅读全文 »
发表于 2022-07-23 19:58阅读次数:46评论次数:0
摘要:1、基于图的邻接矩阵实现下的Prim算法 https://www.cnblogs.com/lx06/p/16478599.html #define T char #define E int #define MAX_COST 0x7FFFFFFF //其他相关代码,可在上述网页链接中找到 E GetW
阅读全文 »
发表于 2022-07-20 15:13阅读次数:59评论次数:0
摘要:1、图的邻接表的基本操作的实现 //删除两点之间的边 void RemoveEgde(GraphLnk *g,T vertex1,T vertex2) { int v1 = GetVertexPos(g,vertex1); int v2 = GetVertexPos(g,vertex2); if(v
阅读全文 »
发表于 2022-07-16 19:50阅读次数:70评论次数:0
摘要:1、图的邻接矩阵的基本操作的实现 #include<stdio.h> #include<malloc.h> #include<assert.h> #define Default_Vertex_Size 10 #define T char //图的定义 typedef struct GraphMtx
阅读全文 »
发表于 2022-07-14 17:28阅读次数:140评论次数:0
摘要:1、图的邻接矩阵表示法实现 #include<stdio.h> #include<malloc.h> #include<assert.h> #define Default_Vertex_Size 10 #define T char //图的定义 typedef struct GraphMtx { i
阅读全文 »
发表于 2022-07-13 17:30阅读次数:22评论次数:0
摘要:
阅读全文 »
发表于 2022-07-08 20:11阅读次数:19评论次数:0
摘要:1、基于线索二叉树实现下相关方法的实现 void InitBinTree(BinTree *bt,ElemType ref); //递归实现线索二叉树 void CreateBinTree(BinTree *bt, char *str); void CreateBinTree(BinTree *bt
阅读全文 »
发表于 2022-07-07 20:25阅读次数:45评论次数:0
摘要:1、线索二叉树的实现 #include<stdio.h> #include<assert.h> #include<malloc.h> #define ElemType char typedef enum{LINK,THREAD}Tag_Type; typedef struct BinTreeNode
阅读全文 »
发表于 2022-07-06 20:14阅读次数:64评论次数:0
摘要:1、非递归实现二叉树的遍历方法 1、非递归 后序遍历 #include<stdio.h> #include<assert.h> #include<malloc.h> #include"PostStack.h" #define ElemType char typedef struct BinTreeN
阅读全文 »
发表于 2022-07-05 20:17阅读次数:42评论次数:0
摘要:1、递归实现二叉树的创建、前中后序遍历、层次遍历、求节点个数、求树高等操作 #include<stdio.h> #include<assert.h> #include<malloc.h> #include"LinkQueue.h" #define ElemType char typedef stru
阅读全文 »
发表于 2022-07-04 19:44阅读次数:73评论次数:0
摘要:1、递归实现二叉树的定义以及创建 #include<stdio.h> #include<assert.h> #include<malloc.h> #define ElemType char typedef struct BinTreeNode { ElemType data; struct BinT
阅读全文 »
发表于 2022-07-03 21:03阅读次数:116评论次数:0
摘要:1、递归实现广义表的创建以及遍历 #include<stdio.h> #include<assert.h> #include<stdlib.h> #include<string.h> #include<malloc.h> #define AtomType int typedef enum{HEAD,
阅读全文 »
发表于 2022-07-03 19:50阅读次数:137评论次数:0
摘要:1、矩阵的相关操作以及矩阵快速转置算法的实现(加减乘并未实现) #include<stdio.h> #include<memory.h> #include<stdlib.h> #include<assert.h> #define ElemType int #define MAXSIZE 100 //
阅读全文 »
发表于 2022-06-29 21:10阅读次数:57评论次数:0
摘要:1、基于顺序存储下串的相关操作以及串匹配模式算法的实现 #include<stdio.h> #include<string.h> #define MAXSTRLEN 20 #define u_char unsigned char typedef u_char SString[MAXSTRLEN+1]
阅读全文 »
发表于 2022-06-24 19:32阅读次数:47评论次数:0
摘要:1、堆栈结构下串基本操作的实现 #include<stdio.h> #include<assert.h> #include<malloc.h> #include<string.h> typedef struct HString //串使用堆存储结构的实现 定义 { char *ch; //串数据存储
阅读全文 »
发表于 2022-06-23 19:21阅读次数:40评论次数:0
摘要:1、顺序结构下实现循环队列 #include<stdio.h> #include<assert.h> #include<malloc.h> #define ElemType int #define MAXSIZE 9 typedef struct Queue //队列节点结构体 { ElemType
阅读全文 »
发表于 2022-06-21 19:11阅读次数:74评论次数:0
摘要:1、链队基本操作的实现 #include<stdio.h> #include<assert.h> #include<malloc.h> #define EType int typedef struct QueueNode //队列节点结构体 { EType data; //节点数据域 struct
阅读全文 »
发表于 2022-06-20 18:55阅读次数:44评论次数:0
摘要:1、利用顺序栈实现进制的转换(该节代码文件类型均为.cpp) #include<stdio.h> #include<malloc.h> #include<assert.h> #include<stdlib.h> #include<iostream> #define ElemType int #def
阅读全文 »
发表于 2022-06-19 16:45阅读次数:116评论次数:0
摘要:1、栈的基本结构以及顺序实现下的一些基本操作 #include<stdio.h> #include<malloc.h> #include<assert.h> #include<stdlib.h> #define ElemType int #define STACK_INIT_SIZE 8 #defi
阅读全文 »