2016年11月13日
摘要: #include<stdio.h>#include<stdlib.h>#define MAXVEX 100 //最大顶点数typedef char VertexType; //顶点typedef int EdgeType; //权值#define UNVISITED -1 //标记未访问#defin 阅读全文
posted @ 2016-11-13 20:41 Dove1 阅读(762) 评论(0) 推荐(0) 编辑
  2016年11月6日
摘要: 图的邻接矩阵存储方式是用两个数组来表示图。一个一维数组存储图中顶点信息,一个二维数组(邻接矩阵)存储图中的边或弧的信息。 设图G有n个顶点,则邻接矩阵是一个n*n的方阵,定义为: 看一个实例,下图左就是一个无向图。 从上面可以看出,无向图的边数组是一个对称矩阵。所谓对称矩阵就是n阶矩阵的元满足aij 阅读全文
posted @ 2016-11-06 16:11 Dove1 阅读(644) 评论(0) 推荐(0) 编辑
  2016年10月30日
摘要: #include<cstdio>#include<iostream>#include<algorithm>using namespace std; typedef struct node{ int data; struct node *lc; struct node *rc; }BiNode,*Bi 阅读全文
posted @ 2016-10-30 19:41 Dove1 阅读(258) 评论(0) 推荐(0) 编辑
  2016年10月29日
摘要: int LeafCount(BiTree T){ if(T==NULL) return 0; if(T->lchild==NULL&&T->rchild==NULL) return 1; else return LeafCount(T->lchild)+LeafCound(T->rchild);} 阅读全文
posted @ 2016-10-29 21:53 Dove1 阅读(422) 评论(0) 推荐(0) 编辑
摘要: typedef char TElemType; typedef struct BiNode{ TElemType data; stuct BiNode *lchild,*rchild;}BiNode,*BiTree; tree create(){ int x; tree t; scanf("%d", 阅读全文
posted @ 2016-10-29 21:53 Dove1 阅读(376) 评论(0) 推荐(0) 编辑
摘要: #include<cstdio>#include<cstring>#include<iostream>using namespace std; struct Node{ char data; Node *lchild,*rchild;}; Node* createtree(string pre,st 阅读全文
posted @ 2016-10-29 21:52 Dove1 阅读(717) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h>#include<stdlib.h>#include<malloc.h>#include<string.h> char s1[1000],s2[1000],s3[1000],s4[1000]; typedef struct node{ char data; stru 阅读全文
posted @ 2016-10-29 21:50 Dove1 阅读(333) 评论(0) 推荐(0) 编辑
摘要: 实验目的:掌握二叉树的二叉链存储结构及表示。 掌握二叉树的三种遍历算法(递归和非递归两类)。 运用三种遍历的方法求解二叉树的有关问题。 实验内容:实现二叉树的二叉链表存储结构; 实现先序、中序和后序遍历二叉树; 遍历二叉树的应用:计算叶子结点、左右子树交换等。 要求:1、二叉树基本操作已实现,学习和 阅读全文
posted @ 2016-10-29 21:48 Dove1 阅读(957) 评论(0) 推荐(0) 编辑
  2016年10月27日
摘要: Bessie has gone to the mall's jewelry store and spies a charm bracelet. Of course, she'd like to fill it with the best charms possible from the N (1 ≤ 阅读全文
posted @ 2016-10-27 22:10 Dove1 阅读(664) 评论(0) 推荐(0) 编辑
摘要: 大学英语四级考试就要来临了,你是不是在紧张的复习?也许紧张得连短学期的ACM都没工夫练习了,反正我知道的Kiki和Cici都是如此。当然,作为在考场浸润了十几载的当代大学生,Kiki和Cici更懂得考前的放松,所谓“张弛有道”就是这个意思。这不,Kiki和Cici在每天晚上休息之前都要玩一会儿扑克牌 阅读全文
posted @ 2016-10-27 08:46 Dove1 阅读(188) 评论(0) 推荐(0) 编辑