数据结构
文章平均质量分 78
衢州小伙
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
查找二叉树的操作
#include #include typedef int Elemtype; typedef struct TreeNode *SearchTree; typedef struct TreeNode *position; struct TreeNode { Elemtype Element; SearchTree Left; SearchTree Right; }; /*建立一颗空树*/原创 2015-06-29 00:10:25 · 623 阅读 · 0 评论 -
数据结构:查找
一. 静态查找表 静态查找表是仅对查找表进行查找操作,而不能改变其中数据的线性表,可以是基于数组的顺序存储或以线性链表存储。静态查找表主要有顺序表、有序顺序表和索引顺序表三种。 1. 顺序查找 函数模型 int seqsearch(element list[], int searchnum, int n) { int i; for (i=0;i < n; i++) //遍历这n个原创 2015-06-07 22:48:55 · 577 阅读 · 0 评论 -
堆栈判断文本括弧是否对称
#include #include #include #define Maxsize 10 typedef char elemtype; struct Node; typedef struct Node *PtrToNode; typedef PtrToNode Stack; typedef struct Node { elemtype ch; Stack next; }Node; S原创 2015-06-28 15:53:44 · 626 阅读 · 0 评论 -
设计在单链表中删除值相同的多余结点的算法
#include #include typedef int ElemType; typedef struct Lnode { ElemType date; struct Lnode* next; }*LNode; LNode InitLnode(void) //初始化链表 { LNode L; L = (LNode)malloc(sizeof(struct原创 2015-06-30 20:24:09 · 19417 阅读 · 4 评论 -
设有两个集合A和集合B,要求设计生成集合C=A∩B的算法,其中集合A、B和C用链式存储结构表示
#include #include typedef int ElemType; typedef struct Lnode { ElemType date; struct Lnode* next; }*LNode; LNode InitLnode(void) //初始化链表 { LNode L; L = (LNode)malloc(sizeof(struct原创 2015-06-30 21:17:57 · 16877 阅读 · 1 评论 -
简单的学籍管理系统
#include #include typedef struct student { int num; //学号 char name[20]; //姓名 float Chinese; //语数外成绩 float Math; float English; float Average;原创 2015-07-01 21:39:38 · 1014 阅读 · 0 评论 -
poj3253Fence Repair 解题题解
Fence Repair Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 30807 Accepted: 9947 Description Farmer John wants to repair a small length of the fence aroun原创 2015-07-09 22:22:01 · 912 阅读 · 0 评论 -
二叉堆
#include #include int lowbit(int x) { int z; z = ~x; z++; return (x & z); } //测试 /*int main(void) { int n,t; n = 50; while(n) { t = lowbit(n); printf("%d\n",t); n -= t; } return 0; }原创 2015-07-09 22:25:05 · 1267 阅读 · 0 评论 -
左偏树
#include #include typedef struct node { int key,dist; struct node *Left,*Right; }LeftistTree; void Swap(LeftistTree** a,LeftistTree** b) { LeftistTree *tmp; tmp = *a; *a = *b; *b = tmp; } Leftis原创 2015-07-10 00:19:48 · 833 阅读 · 0 评论
分享