2

```
template <class T>
struct NODE {
NODE<T> *pNext;
T Data;
};
template <class T>
class stack{
private:
NODE<T> * top;
public:
stack();
~stack();
void push (T data); //pushes a new node with data
type T in a stack
bool pop (T &data); //pops out the top most node
from the stack
void printStack(); //prints all elements of a stack
};
template <class Type>
class queue {
private:
NODE<T> * front;
NODE<T> * tail;
public:
queue ();
~queue();
bool dequeue ( Type & data); //removes first node
from a queue
bool enqueue (Type val); //appends a new node in
a queue
};
```