
队列
心若雪
c++学习中......
展开
-
数据结构-队列(链式)(c++)
#include<iostream> using namespace std; //双向循环链队 template<typename T> class node { public: node() { data = NULL; next = nullptr; from = nullptr; } node(T _data) { data = _data; next = nullptr; from = nullptr; } T data; node* next; .原创 2022-05-04 18:32:21 · 230 阅读 · 0 评论 -
数据结构-队列(顺序表示)(c++)
#include<iostream> using namespace std; //循环顺序队列 template<typename T> class listQueue { public: listQueue(int _max = 10) { max = _max; Q = new T[max]; tail = 0; head = 0; length = 0; } ~listQueue() { delete[] Q; } //入 void inPut(T elem.原创 2022-05-04 18:30:31 · 465 阅读 · 0 评论