停车厂管理系统数据结构与算法设计队列代码:#ifndef LinkedQueue_#define LinkedQueue_#include "node.h"#include "xcept.h"templateclass LinkedQueue { public: LinkedQueue() {front = rear = 0,pos=0;} ~LinkedQueue(); LinkedQueue& Add(T& x,T& y); LinkedQueue& Delete(T& x,T& y);/********************************************/ int Position() { return pos; } //得到车在队列中的位置 private: Node *front; Node *rear; int pos;/**************************************************/};templateLinkedQueue::~LinkedQueue(){// Queue destructor. Delete all nodes. Node *next; while (front) { next = front->link; delete front; front = next; }}templateLinkedQueue& LinkedQueue::Add(T& x,T& y){ Node *p = new Node; p->data=x; p->time=y; p->link=0; pos++; if (front) { rear->link = p; } else front = p; rear = p; return *this;}templateLinkedQueue& LinkedQueue::Delete(T& x,T& y){ x=front->data;y=front->time; pos--; Node *p = front; front = front->link; delete p; return *this;}#endif节点代码:#ifndef Node_#define Node_template class LinkedQueue;template class Node {friend LinkedQueue; public: T data; T time; Node *link;};#endif栈的代码:#ifndef Stack_#define Stack_#include "xcept.h"templateclass Stack {// LIFO objects public: Stack(int MaxStackSize = 10); ~Stack() {delete [] stack;} bool IsEmpty() const {return top == -1;} bool IsFull() const {return top == MaxTop;} T Top() const; Stack& Add(const T& x); Stack& Delete(T& x); int top; // current top of stack int MaxTop; // max value for top T *stack; // element array};templateStack::Stack(int MaxStackSize){// Stack constructor.MaxTop = MaxStackSize - 1;stack = new T[MaxStackSize];top = -1;}templateT Stack::Top() const{// Retu...