#include #include class node { friend class Istack; int data; node* next; node(int d, node* n) { data = d; next = n; } // builder and initializer of node }; class Istack { // linked list implementation node* top; public: void init(int Nitems = 100) { top = NULL; } void push(int x) { top = new node(x, top); } int pop() { assert( !isempty() ); int temp = top -> data; // get data node* oldtop = top; // point to old top = top -> next; // unlink old delete oldtop; // discard return temp; } bool isempty() { return( top == NULL ); } bool isfull() { return( FALSE ); } // Never Full };