#include "Vstack.h" #include template class Link_stack : public Gstack { struct node { T data; node* next; node(T d, node* n) { data = d; next = n; } }; node* top; public: Link_stack( ) { top = NULL; } void push(T x) { top = new node(x, top); } T pop() { assert( !isempty() ); T t = top -> data; node* oldtop = top; top = top -> next; delete oldtop; return t; } bool isempty() { return( top == NULL ); } bool isfull() { return( FALSE ); } };