
数据结构
文章平均质量分 59
繁星逸夜
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
数据结构 栈(四则表达式)
#include "stdio.h" #define MAXSIZE 20 #define max_size 30 typedef struct { int data[MAXSIZE]; int top; }NumberStack,*pNumberStack;//数字栈 typedef struct { char data[MAXSIZE]; int top; }SymbolStack原创 2014-05-06 23:06:26 · 618 阅读 · 0 评论 -
数据结构 链表(静态链表)
#include "stdio.h" #define MAXSIZE 100 /** 静态链表: 在C语言之前,如Basics、Fortran等早期的编程高级语言,由于没有指针,链表没法是实现 有人想出用数组来代替链表 首先让数组的元素怒都是由两个数据与组成 data 和 cur 数据域data 用来存放数据元素 游标 cur等同于单链表的next指针,存放钙元素的后原创 2014-05-07 18:14:30 · 611 阅读 · 0 评论 -
数据结构 树(二叉树 链式存储)
#include "stdio.h" #include "malloc.h" #include "stdlib.h" #define MAXNODE 100 typedef char TElemType; typedef struct BiTNode { TElemType data; struct BiTNode *lchild,*rchild; }BiTNode,*BiTree; //原创 2014-05-11 17:03:58 · 691 阅读 · 0 评论 -
数据结构 树(线索二叉树)
/* 二叉树的链式存储中不能够得到一个结点的前驱和后继的信息 这些信息只有在遍历的动态过程中才能得到。 为了保存这种在遍历中也可得到的信息 最简单的方法就是为每一个结点增加两个指针域;fwd和bkwd 注:此处的前驱和后继为:遍历过程中的前驱和后继(误解:该结点的父节点和子节点) 另外在n个结点中,必存在n+1个空链域(因为满二叉树总结点树2n+1,个人理解的) 由此设想能否利用这些空原创 2014-05-11 17:05:39 · 566 阅读 · 0 评论 -
数据结构 树(树与等价问题)
树 离散数学中,对等关系和等价类的定义是: 如果集合S中的关系R是自反的、对称的和传递的,则成它为一个等价关系 划分等价类需要对集合进行的操作有3个:1、构造只含有单个成员的集合,2、判断某个单元所在子集,3、归并两个互不相交的集合为一个集合 由此,需要一个包含上述3种操作的数据类型MFSet ADT MFSet{ 数据对象:若设S是MF原创 2014-05-12 20:30:25 · 7323 阅读 · 0 评论 -
数据结构 三种简单的排序(插入、选择、冒泡)
#include "stdio.h" #include "stdlib.h" #include "time.h" #define MAX 10 #define SWAP(x,y) {int t;t=x; x=y; y=t;} void selsort(int []); void insort(int []); void bubsort(int []); void bubsort1(in原创 2014-09-07 18:37:42 · 554 阅读 · 0 评论 -
数据结构 shell 快速
#include "stdio.h" #include "stdlib.h" #include "time.h" #define MAX 10 #define SWAP(x,y) {int t = x; x= y; y =t;} int n=0; void shell(int [],int); void main() { int number[MAX]={0}; int i; in原创 2014-09-12 11:44:59 · 788 阅读 · 0 评论 -
数据结构 排序算法 (插入、快速、Shell、堆、合并)
#include "stdio.h" #include "time.h" #include "stdlib.h" #define MAX 10 #define SWAP(x,y){int t=x;x=y;y=t;} void RandNumber(int []);//产生随机数 void PrintNumber(int []);//打印 void InsertSort(int []);//插原创 2014-10-01 23:06:49 · 637 阅读 · 0 评论 -
KMP算法代码案例
#include <stdio.h> #include <string.h> #include <stdlib.h> int *computer_prefix(char *str_p,int *tt){ if(NULL == str_p) return NULL; int i=0,j=0; int m = strlen(str_p); tt[0]=0;转载 2017-03-27 15:49:56 · 352 阅读 · 0 评论