2017年3月7日

pat1020

摘要: #include #include #include typedef struct node{ int value; struct node* left; struct node* right; }node; using namespace std; node* f(int in[],int post[],int length){ node* root=(node*)mall... 阅读全文

posted @ 2017-03-07 22:33 SijingLin 阅读(78) 评论(0) 推荐(0) 编辑

2016年11月3日

图的遍历

摘要: /* 邻接表存储的图 - DFS */ void Visit( Vertex V ) { printf("正在访问顶点%d\n", V); } /* Visited[]为全局变量,已经初始化为false */ void DFS( LGraph Graph, Vertex V, void (*Visit)(Vertex) ) { /* 以V为出发点对邻接表存储的图Graph进行... 阅读全文

posted @ 2016-11-03 18:01 SijingLin 阅读(124) 评论(0) 推荐(0) 编辑

图的邻接表表示法

摘要: /* 图的邻接表表示法 */ #define MaxVertexNum 100 /* 最大顶点数设为100 */ typedef int Vertex; /* 用顶点下标表示顶点,为整型 */ typedef int WeightType; /* 边的权值设为整型 */ typedef char DataType; /* 顶点存储的数据类型设... 阅读全文

posted @ 2016-11-03 16:48 SijingLin 阅读(172) 评论(0) 推荐(0) 编辑

* 图的邻接矩阵表示法 */

摘要: * 图的邻接矩阵表示法 */ #define MaxVertexNum 100 /* 最大顶点数设为100 */ #define INFINITY 65535 /* ∞设为双字节无符号整数的最大值65535*/ typedef int Vertex; /* 用顶点下标表示顶点,为整型 */ typedef int WeightType; /*... 阅读全文

posted @ 2016-11-03 16:47 SijingLin 阅读(163) 评论(0) 推荐(0) 编辑

2016年10月20日

堆及操作集_mooc

摘要: typedef struct HNode *Heap; /* 堆的类型定义 */ struct HNode { ElementType *Data; /* 存储元素的数组 */ int Size; /* 堆中当前元素个数 */ int Capacity; /* 堆的最大容量 */ }; typedef Heap MaxHeap; /* 最大堆 ... 阅读全文

posted @ 2016-10-20 22:28 SijingLin 阅读(134) 评论(0) 推荐(0) 编辑

2016年10月11日

(数据结构)部分稀疏矩阵的操作

摘要: //顺序 typedef struct { int row, col; //非零元素的行号、列号 ElemType val; //元素值}Triple;typedef struct { int m, n, t; //矩阵的行、列数及非零元素个数 Triple sm[MaxTerms + 1]; // 阅读全文

posted @ 2016-10-11 17:50 SijingLin 阅读(237) 评论(0) 推荐(0) 编辑

2016年9月22日

PAT1043 BST 镜像管不了了

摘要: 考虑到 出现相同的数等等 阅读全文

posted @ 2016-09-22 21:36 SijingLin 阅读(138) 评论(0) 推荐(0) 编辑

2016年9月18日

PAT1004 Counting Leaves (30) 数组链式建树

摘要: 一开始尝试用二叉树,最后用结构 struct node{ int k; int son[101];}; son[i]记录子结点 阅读全文

posted @ 2016-09-18 14:10 SijingLin 阅读(122) 评论(0) 推荐(0) 编辑

2016年9月8日

对拍

摘要: http://blog.csdn.net/wyt734933289/article/details/47400433 有些数据造不出来 错误的 freopen("e:\\duipai\\data.txt","r",stdin); freopen ("e:\\duipai\\out2.txt","w" 阅读全文

posted @ 2016-09-08 16:10 SijingLin 阅读(101) 评论(0) 推荐(0) 编辑

二叉查找树(Binary Search Tree)

摘要: 原理 编辑 原理 二叉排序树的查找过程和次优二叉树类似,通常采取二叉链表作为二叉排序树的存储结构。中序遍历二叉排序树可得到一个关键字的有序序列,一个无序序列可以通过构造一棵二叉排序树变成一个有序序列,构造树的过程即为对无序序列进行排序的过程。每次插入的新的结点都是二叉排序树上新的叶子结点,在进行插入 阅读全文

posted @ 2016-09-08 14:38 SijingLin 阅读(117) 评论(0) 推荐(0) 编辑

导航