数据结构(C++)
文章平均质量分 85
sense_long_h
这个作者很懒,什么都没留下…
展开
-
单链表(c++带头结点,)
#ifndef _SEQLIST_ #define _SEQLIST_ #include using namespace std; #include template class Slist; //节点类 template class Node { public: Node() :data(Type()), next(NULL){} Node(Type d, Node *n = NULL原创 2015-08-29 09:30:49 · 922 阅读 · 0 评论 -
双循环链表(C++)
#ifndef _DCLIST_ #define _DCLIST_ #include using namespace std; #include template class DCList; template class Node { friend class DCList; public: Node():data(0),prio(NULL),next(NULL){} Node(T原创 2015-08-29 09:36:53 · 713 阅读 · 0 评论 -
简单的静态链表
#ifndef __STATICLIST_ #define __STATICLIST_ #include using namespace std; #define MAXSIZE 8 #define ElemType int typedef struct StaticListNode { ElemType data; int cur; }StaticListNode; ty原创 2015-08-29 09:42:27 · 582 阅读 · 0 评论 -
堆二叉树
堆(heap)又被为优先队列(priority queue)。尽管名为优先队列,但堆并不是队列。回忆一下,在队列中,我们可以进行的限定操作是dequeue和enqueue。dequeue是按照进入队列的先后顺序来取出元素。而在堆中,我们不是按照元素进入队列的先后顺序取出元素的,而是按照元素的优先级取出元素。 堆的一个经典的实现是完全二叉树(complete binary tr原创 2015-09-27 14:56:32 · 622 阅读 · 0 评论