![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构
ricexx
编程小白
展开
-
单链表的c++实现
单链表的c++实现#include<iostream>using namespace std;template <class T>struct Node //结点定义{ T data; Node<T> *ne原创 2018-12-27 20:44:10 · 1869 阅读 · 2 评论 -
二叉树及操作c++
//二叉树及操作#include<iostream>#include<cstring>using namespace std;template<class T>struct Node1//栈和队列共用结构{ T data; Node1<T> *next;};//栈和队列其实都可以直接调用。//栈定义template<cl...原创 2018-12-28 09:35:49 · 205 阅读 · 0 评论 -
链队列的c++实现
//链队列#include<iostream>using namespace std;struct Node{ int data; Node *next;};class linkque{ Node *front, *rear;//队头指针,队尾指针public: linkque(); ~linkque(); void enque(int x);//入队 i...原创 2018-12-28 08:44:56 · 1937 阅读 · 1 评论 -
多项式的储存与运算c++
#include<iostream>using namespace std;template<class T>struct Node{ float coef;//系数 int exp;//指数 Node<T> *next;//指针};template<class T>class Linklist{ Node<T> ...原创 2018-12-27 20:51:22 · 1059 阅读 · 0 评论 -
约瑟夫环的c++实现
//约瑟夫环#include<iostream>using namespace std;template<class T>struct Node //结点结构{ T data; //结点数据 Node<T> *next;};template<class T>class linklist//循环链表{ Node<T...原创 2018-12-27 20:42:01 · 2524 阅读 · 0 评论 -
回文数c++
//回文数#include&lt;iostream&gt;#include&lt;string&gt;using namespace std;template&lt;class T&gt;struct Node{ T data; Node&lt;T&gt; *next;};template&lt;class T&gt;class原创 2018-12-28 09:45:33 · 776 阅读 · 0 评论 -
哈夫曼树c++
#include&lt;iostream&gt;#include&lt;iomanip&gt;#include&lt;stack&gt;using namespace std;struct element{ int weight; int lchild, rchild, parent;};class HTree{ element *node; int n, m; stac...原创 2018-12-28 09:44:08 · 1201 阅读 · 0 评论 -
图的邻接矩阵表示c++
#include<iostream>#include<queue>using namespace std;enum graphtype { undigraph, digraph, undinetwork, dinetwork };//枚举template<class T>struct edgetype{ T head, tail; int cos...原创 2018-12-29 14:39:17 · 654 阅读 · 1 评论