
数据结构与算法
文章平均质量分 88
arrowcat
这个作者很懒,什么都没留下…
展开
-
数据结构与算法系列---栈
栈的实现代码及操作:#include malloc.h>#include stdio.h>#define STACK_INIT_SIZE 100#define INCREMENT 10#define OVERFLOW -2#define OK 1#define ERROR 0#define TRUE 1#define FALSE 0typedef int ElemTyp原创 2008-04-01 12:39:00 · 850 阅读 · 0 评论 -
数据结构与算法系列---顺序表
数据结构和算法是计算机科学的基础和灵魂,对于程序员来说,其重要不言而喻!它是每一个程序员的必须具备的内功,还记得那个经典的公式吗? 程序=数据结构+算法一语道出了程序的本质.由于考研,对数据结构和算法好好学了一遍,领会到不少东西,对我编程能力和算法设计能力是一个极大的提高.现在考完研了,我整理了一下,希望对要考研的能有所帮助,其中的程序全是根据>(严蔚敏)原创 2008-04-01 11:47:00 · 1341 阅读 · 1 评论 -
数据结构与算法系列---单链表
链表的实现及对它的一些操作: #include malloc.h>#define ERROR 2#define OK 1typedef int ElemType;typedef struct LNode...{ ElemType data; struct LNode *next;} LNode,*LinkList;//初始化LinkList ListInit()...{原创 2008-04-01 11:58:00 · 910 阅读 · 0 评论 -
数据结构与算法系列---字符串
字符串的实现及操作:#include malloc.h>#define OK 1#define ERROR 0#define OVERFLOW -2typedef struct...{ char *ch; int length;}HString;//清空void ClearString(HString *s)...{ if(s->ch) ...{原创 2008-04-02 12:34:00 · 960 阅读 · 0 评论 -
数据结构与算法系列---数组
数组的实现及操作:#define MAXSIZE 100#define OK 1#define ERROR 0#define OVERFLOW -2typedef int ElemType;typedef struct ...{ int i,j; ElemType e;}Triple;typedef struct ...{ Triple data[MAX原创 2008-04-02 12:43:00 · 963 阅读 · 0 评论 -
数据结构与算法系列---二叉树
二叉树的代码实现及操作:#include malloc.h>#define OK 1#define ERROR 0#define OVERFLOW -2#define TURE 1#define FALSE 0#define QMAXSIZE 20typedef int TElemType;typedef struct BiTNode...{ TElem原创 2008-04-02 19:29:00 · 947 阅读 · 1 评论 -
数据结构与算法系列---B-树
B-树是一种平衡的多路查找树,它有较高的查找的效率,在文件系统中很有用.一、B-树的定义 一棵"m 阶的B树"或为空树,或为具有以下特性的 m 叉查找树: (1)树中每个结点至多有 m 棵子树; (2)除根以外的所有非叶结点至少有 [m/2 ]棵子树,根结点若是非叶结点,则至少有两棵子树; (3)所有的非叶结点中含有如下信息: (n,A0,(K1,D1),A1,(K2原创 2008-04-07 11:25:00 · 1140 阅读 · 0 评论 -
数据结构与算法系列---队列
#include malloc.h>#define OK 1#define ERROR 0#define OVERFLOW -2#define MAXQSIZE 20typedef int QElemType;typedef struct SqQueue...{ QElemType *base; int front; int rear;}SqQueue;/原创 2008-04-02 12:25:00 · 876 阅读 · 0 评论 -
数据结构与算法系列---图
图的代码实现及操作:#include malloc.h>#define MAX_VERTEX_NUM 20#define INF 32767 //无穷大#define OK 1#define ERROR 0#define OVERFLOW -2#define FALSE 0#define TRUE 1typedef enum ...{DG,DN,UDG原创 2008-04-02 19:39:00 · 1135 阅读 · 0 评论