数据结构
ygbada
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
二叉树三种遍历方式(递归)
二叉树的先序、中序、后序遍历,采用递归实现。#include<stdio.h>#include<stdlib.h>typedef char DataType;//定义二叉树类型的节点typedef struct BTnode{ DataType data;//数据域 struct BTnode* lchild,*rchild;//左孩子和右孩子...2012-11-23 17:28:16 · 153 阅读 · 0 评论 -
二叉树三种遍历方式(非递归)
二叉树的先序、中序、后序遍历,采用非递归实现。非递归实现的一个基本思路:在遍历的过程中要用栈来保存遍历中经过的结点。#include<stdio.h>#include<stdlib.h>typedef char DataType;//定义二叉树类型的节点typedef struct BTnode{ DataType data;//数据域 ...2012-11-23 19:51:04 · 151 阅读 · 0 评论 -
二叉树的层次遍历
二叉树的层次遍历。#include<stdio.h>#include<stdlib.h>typedef char DataType;//树结点的数据类型定义typedef struct BTnode{ DataType data; struct BTnode* lchild,*rchild;}BTree;//队列的结点数据类型定义ty...原创 2012-11-23 22:50:09 · 121 阅读 · 0 评论 -
队列的链式实现
#include<stdio.h>#include<stdlib.h>typedef char DataType;//定义队列中的结点类型typedef struct node{ DataType data; struct node * next;}qnode;//定义队列的队头和队尾指针typedef struct{ q...2012-11-28 15:44:24 · 133 阅读 · 0 评论 -
循环队列的实现
#include<stdio.h>#define size 10 //最大队列长度,实际上只能存入(size-1)个数据typedef char DataType;//循环队列可以解决顺序队列的假满现象//循环队列的类型定义typedef struct { DataType data[size];//存储队列的数据空间 int front,rear;/...2012-11-28 16:11:16 · 114 阅读 · 0 评论 -
无向图的DFS和BFS遍历
#include<stdio.h>#include<stdlib.h>#include<string.h>#define MAX_VER 100//最大顶点数typedef struct edgnode{//邻接点域 int vertex; struct edgnode *next;}enode;typedef struc...2012-12-16 19:26:53 · 541 阅读 · 0 评论
分享