![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构
za30312
这个作者很懒,什么都没留下…
展开
-
环队列
#include <stdlib.h>#include <stdio.h>#include <conio.h>#include <iostream>#include <windows.h>#include <string.h>using namespace std;const MAXSIZE = 20;typedef int elemType; //定义栈元素类型class Q原创 2016-10-23 16:53:02 · 324 阅读 · 0 评论 -
归并算法
#include <stdio.h>void MSort( ElementType A[], ElementType TmpArray[ ], int Left, int Right){ int Center; if( Left < Right) { Center = ( Left + Right ) / 2;原创 2017-02-27 10:53:23 · 213 阅读 · 0 评论 -
优先队列(缺)
#include <stdio.h>typedef int ElementType;struct HeapStruct;typedef struct HeapStruct *PriorityQueue;PriorityQueue Initialize( int MaxElements );void Destroy( PriorityQueue H );void MakeEmpty( Prio原创 2017-02-27 10:52:30 · 206 阅读 · 0 评论 -
链栈
#include <iostream>using namespace std;class node{ friend class Linkstack; //友元类private: long data; node * next; //递归定义指向后继结点的指针 };class Linkstack{ public: Linkstack(原创 2016-12-01 22:43:24 · 238 阅读 · 0 评论 -
哈希表 挂链法
#include <stdio.h>#include <windows.h>int HelpPosition;int position;typedef int ElementType;/* 单链表定义 */typedef struct Node *PtrToNode;struct Node{ ElementType data; //存储数据 in原创 2016-12-02 15:09:33 · 626 阅读 · 0 评论 -
建立图
学习MOOC上的#include <stdio.h>#include <windows.h>#define MaxVertexNum 100 /* 最大顶点数设为100 */#define INFINITY 65535 /* ∞设为双字节无符号整数的最大值65535*//* 边的定义 */typedef struct ENode *PtrToENode;struct转载 2016-12-02 15:08:16 · 439 阅读 · 0 评论 -
二叉树 递归 非递归
#include <iostream>#include <string.h>#include <stack> #include <windows.h>using namespace std;typedef struct node{ char data; struct node *lchild,*rchild;}BinTree;typedef struct node1{转载 2016-12-02 15:06:50 · 192 阅读 · 0 评论 -
链队
#include <iostream>using namespace std;int poporder = 0; class node{ friend class Queue; //友元类private: long data; node * next; //递归定义指向后继结点的指针 };class Queue{public: Queue(原创 2016-12-02 14:56:24 · 230 阅读 · 0 评论 -
顺序栈
对全局变量有些依赖,要改进#include <iostream>using namespace std;typedef int elemType; //定义栈元素类型const elemType MAXSIZE = 100;int poporder = 0;class Seqstack{public: Seqstack(); ~Seqstack(); bo原创 2016-12-01 22:47:56 · 199 阅读 · 0 评论 -
链表存储基本操作
#include <stdio.h>#include <stdlib.h> #include <string.h>#include <windows.h>/*定义表示结点的结构体类型*/typedef struct list { int data; struct list* next; }LIST;void add(int data);LIST* findBack(原创 2016-12-01 22:39:36 · 621 阅读 · 0 评论 -
N皇后递归
#include<bits/stdc++.h>using namespace std;void NQueen( int k); int queenPos[1000];int N; int main(){ cin >> N; NQueen(0); return 0; }void NQueen( int k) { //在0~k-1行皇后已经摆好的情况下,原创 2017-04-02 12:43:31 · 336 阅读 · 0 评论