Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include "simpio.h"
- #include "console.h"
- #include "MyQueue.h"
- using namespace std;
- int main(){
- MyQueue queue;
- for(int i = 1; i < 12; i++){
- queue.enque(i);
- }
- cout << "size = " << queue.size() << " must be 11" << endl;
- cout << "testing peek(), must return 1 -> " << queue.peek() << endl;
- cout << "begining deque, from 1 to 11" << endl;
- for(int i = 0; i < 11; i++){
- cout << queue.deque() << endl;
- }
- cout << "end of deque" << endl;
- cout << "size = " << queue.size() << " must be 0" << endl;
- cout << "testing isEmpty(). value should be 1 -> " << queue.isEmpty() << endl;
- for(int i = 0; i < 110; i++){
- queue.enque(i);
- }
- for(ont i = 0; i< 110; i++){
- queue.deque();
- }
- cout << "now it should throw error" << endl;
- cout << queue.deque();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement