#include<iostream>#include"LinkedList_simplified.h"usingnamespacestd;template<typenameT>classxStack:publicLinkedList<T>//don't miss <T> here
{public:T&gettop(){returnLinkedList<T>::begin();}voidpush(Trhs){LinkedList<T>::insert(0,rhs);}boolpop(T&popout){if(LinkedList<T>::size()==1){cout<<"error:Already Empty"<<endl;returnfalse;}else{popout=LinkedList<T>::begin();LinkedList<T>::erase(1);returntrue;}}};
#include<iostream>#include"LinkedList_simplified.h"usingnamespacestd;template<typenameT>classxQueue:publicLinkedList<T>//don't miss <T> here
{public:voidinQueue(Trhs){this->insert(this->size()-1,rhs);}booldeQueue(T&out){if(this->begin_itr()->next==NULL){cout<<"error:Already Empty"<<endl;returnfalse;}else{out=this->begin_itr()->next->data;this->erase(1);returntrue;}}};