11935 - double-end-queue   

Description

There's a dequeue already define in "function.h" and stack , queue inherit from the _dequeue.

Please implement those function below:

stack::

        void push(const _node N);
        void pop();
        _node* get_data();

queue::

        void push(const _node N);
        void pop();
        _node* get_data();

 

Good luck.

 

 

Input

There will be few instruction in input [cont] [inst] [data].

cont and inst will be string

cont will be "stack" or "queue"

inst will be "push", "pop", "front" for queue only and "top" for stack only.

data will be optional (only when push inst , it will give the data ")


"exit" means exit

 

Output

In every "get_data"(top or front) commands , it will be single line with the data.

Sample Input  Download

Sample Output  Download

Partial Judge Code

11935.cpp

Partial Judge Header

11935.h

Tags




Discuss