数据结构
文章平均质量分 76
Get *null
这个作者很懒,什么都没留下…
展开
-
循环队列的表示和实现(数据结构)
#include #include #define ERROR 0 #define OK 1 #define OVERFLOW -2 #define MAXQSIZE 6 typedef int Status; typedef int QElemType; typedef struct { QElemType *base; int front; int rear;原创 2015-11-11 10:47:59 · 585 阅读 · 0 评论 -
Huffman树及Huffman编码(数据结构)
#include #include #include #define MAXSIZE 10 #define CHARNUM 26 typedef struct { int weight; int parent,lchild,rchild; } HTNode,*HuffmanTree; typedef char **HuffmanCode; void StatCharNum(char原创 2015-12-08 12:54:50 · 679 阅读 · 2 评论 -
合并果子(贪心+优先队列)
C - 合并果子 Crawling in process...Crawling failedTime Limit:1000MS Memory Limit:131072KB 64bit IO Format:%lld & %llu SubmitStatus Description 现在有n堆果子,第i堆有ai个果子。现在要把这些果子合并成一堆,每次合并的代价是两堆果原创 2016-01-23 16:02:33 · 2504 阅读 · 0 评论 -
优先队列的用法
在优先队列中,优先级高的元素先出队列。 标准库默认使用元素类型的 优先队列的第一种用法,也是最常用的用法: priority_queueint> qi; 通过 故示例1中输出结果为:9 6 5 3 2 第二种方法: 在示例1中,如果我们要把元素从小到大输出怎么办呢? 这时我们可以传入一个比较函数,使用functional.h函数对象作为比较函数。 priority转载 2016-01-23 12:06:20 · 718 阅读 · 0 评论 -
线索二叉树的遍历(数据结构)
#include #include #define ERROR 0 #define OK 1 #define OVERFLOW -2 typedef int Status; typedef char TElemType; typedef enum {Link,Thread} PointerTag; typedef struct BiThrNode { TElemType data;原创 2015-11-25 10:41:39 · 584 阅读 · 0 评论 -
二叉树的遍历(数据结构)
#include #include #define ERROR 0 #define OK 1 #define OVERFLOW -2 typedef int Status; typedef char TElemType; typedef struct BiTNode { TElemType data; struct BiTNode *lchild,*rchild; } BiTNod原创 2015-11-18 10:56:41 · 716 阅读 · 1 评论 -
栈的顺序表示和实现(数据结构)
#include #include #define ERROR 0 #define OVERFLOW -2 #define OK 1 #define STACK_INIT_SIZE 5 #define STACKINCREMENT 2 typedef int SElemType; typedef int Status; typedef struct { SElemType *base;原创 2015-11-01 11:06:21 · 683 阅读 · 0 评论 -
队列的链式表示和实现(数据结构)
#include #include #define OK 1 #define ERROR 0 #define OVERFLOW -2 #define INFEASIBLE -1 typedef int Status; typedef int QElemType; typedef struct QNode { QElemType data; struct QNode *next; }原创 2015-11-01 11:21:55 · 1023 阅读 · 0 评论 -
线性表的链式表示和实现(数据结构)
#include #include #define ERROR 0 #define OVERFLOW -2 #define OK 1 typedef int ElemType; typedef int Status; typedef struct LNode{ ElemType data; struct LNode *next; }LNode,*LinkList; void Cre原创 2015-11-01 10:46:31 · 479 阅读 · 0 评论 -
双向链表的算法设计和实现(数据结构)
#include #include #define Status int #define ElemType int #define OK 1 #define ERROR 0 #define OVERFLOW -2 typedef struct DuLNode { ElemType data; struct DuLNode *prior; struct DuLNode *ne原创 2015-11-13 13:43:55 · 808 阅读 · 0 评论 -
线性表的顺序表示和实现(数据结构)
#include #include #define ERROR 0 #define OVERFLOW -2 #define LIST_INIT_SIZE 5 #define LISTINREMENT 2 #define OK 1 typedef int Status; typedef int ElemType; typedef struct { ElemType *elem; in原创 2015-10-27 16:47:01 · 450 阅读 · 0 评论 -
2011年第二届蓝桥杯(C/C++)预赛题目及个人答案(欢迎指正)
第一题 代码填空 (满分3分) 神秘的三位数 有这样一个3位数,组成它的3个数字阶乘之和正好等于它本身。即:abc = a! + b! + c! 下面的程序用于搜索这样的3位数。请补全缺失的代码。 把填空的答案(仅填空处的答案,不包括题面)存入考生文件夹下对应题号的“解答.txt”中即可。 int JC[] = {1,1,2,6,24,120,720,5040,40320,36原创 2016-01-31 23:58:06 · 5344 阅读 · 0 评论