2017年1月18日
摘要: #define MaxSize <储存数据元素的》最大个数> struct QNode{ ElementType Data[MaxSize]; int rear; int front; }; typedef struct QNode *Queue; void AddQ(Queue PtrQ,Elem 阅读全文
posted @ 2017-01-18 15:45 chy89224 阅读(168) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2017-01-18 01:58 chy89224 阅读(119) 评论(0) 推荐(0) 编辑
  2017年1月17日
摘要: typedef struct SNode *Stack; struct SNode{ ElementType Data; struct SNode *Next; }; Stack CreateStack() {//构建一个堆栈的头结点,返回指针 Stack S; S=(Stack)malloc(si 阅读全文
posted @ 2017-01-17 22:30 chy89224 阅读(128) 评论(0) 推荐(0) 编辑
摘要: #define MaxSize <储存数据元素的最大个数> typedef struct SNode *Stack; struct SNode{ ElementType Data[MaxSize]; int Top; }; void Push(Stack PtrS,ElementType item) 阅读全文
posted @ 2017-01-17 21:47 chy89224 阅读(133) 评论(0) 推荐(0) 编辑
摘要: typedef struct GNode*GList; struct GNode{ int Tag;//标志域:0表示结点是单元素,1表示结点是广义表 union{ //子表指针域Sublist与单元素数据域Data复用,即共用存储空间 ElementType Data; GList SubList 阅读全文
posted @ 2017-01-17 15:43 chy89224 阅读(115) 评论(0) 推荐(0) 编辑
摘要: typedef struct LNode *List; struct LNode{ ElementType Data; List Next; }; struct LNode L; List PtrL; int Length(List PtrL)//求表长 { List p=PtrL;//p指向表的第 阅读全文
posted @ 2017-01-17 04:07 chy89224 阅读(176) 评论(0) 推荐(0) 编辑
  2017年1月16日
摘要: typedef struct LNode *List; struct LNode{ ElementType Data[MAXSIZE]; int Last; }; struct LNode L; List PtrL; 主要操作的实现 List MakeEmpty()//初始化(建立空的顺序表) { 阅读全文
posted @ 2017-01-16 22:02 chy89224 阅读(174) 评论(0) 推荐(0) 编辑
  2016年12月26日
摘要: 算法1 int MxaSubseqSum1(int A[],int N) {int ThisSum,MaxSum=0; int i,j,k; for(i=0;i<N;i++){//i是子列左端位置 for(j=i;j<N;j++){//j是子列右端位置 ThisSum=0;//ThisSum是从A[ 阅读全文
posted @ 2016-12-26 17:46 chy89224 阅读(140) 评论(0) 推荐(0) 编辑
  2016年12月25日
摘要: 阅读全文
posted @ 2016-12-25 12:33 chy89224 阅读(655) 评论(0) 推荐(0) 编辑
  2016年12月24日
摘要: 因为程序计算太快,所以clock函数捕捉不到区别。 由最后这张图知道秦九韶公式计算多项式更快。duration2比duration1快一个数量级 阅读全文
posted @ 2016-12-24 21:06 chy89224 阅读(192) 评论(0) 推荐(0) 编辑