循环队列

#include <stdio.h>#include <malloc.h>#define OK 1#define ERROR 0#define TRUE 1#define FALSE 0#define OVERFLOW -2typedef int Status;typedef int QElemType;#define MAXQSIZE 6typedef struct{ QElemType *base; int front; int rear;}SqQueue; Status InitQueue(SqQueue &amp;Q){ Q.base=(QElemType*)malloc(MA...
2010-06-20 16:51 | 阅读 682 次 | 评论 0 条

关键路径

//006.h #include <stdio.h>#include <stdlib.h>typedef int Status;typedef int SElemType; #define ERROR 0#define OK 1#define OVERFLOW -2#define STACK_INIT_SIZE 10#define STACKINCREMENT 2typedef struct { SElemType *base; SElemType *top; int stacksize;}SqStack; Status InitStack(SqStack &amp;S){ if(...
2010-06-20 16:49 | 阅读 662 次 | 评论 0 条

单链表

//007.h #include <stdio.h>#include <stdlib.h>#include <malloc.h> int over_flag=0; typedef int ElemType;typedef struct LNode{ ElemType data; struct LNode *next;}LNode,*LinkList; void Traverse(LinkList L);void CreateList(LinkList &amp;L);void exchange(LinkList &amp;L);void delete_even(LinkList ...
2010-06-19 10:21 | 阅读 718 次 | 评论 0 条

赫夫曼编码

# include <stdio.h> # include <stdlib.h># include <conio.h># include <string.h># define MAX_LENGTH 100typedef char **HuffmanCode;//**********数据结构*************typedef struct { int weight; //权值 int parent,lchild,rchild; //双亲,左右孩子}HTNode,*HuffmanTree; //结点和指针//**********select函数*******...
2010-06-19 10:15 | 阅读 866 次 | 评论 0 条
文章归档
最新评论