SHARE
TWEET

Untitled

a guest Aug 25th, 2019 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <fstream>
  2. #include <iostream>
  3. #include "simpio.h"
  4. #include "console.h"
  5. #include "MyQueue.h"
  6.  
  7. using namespace std;
  8.  
  9. int main(){
  10.     MyQueue queue;
  11.  
  12.     for(int i = 1; i < 12; i++){
  13.         queue.enque(i);
  14.     }
  15.  
  16.     cout << "size = " << queue.size() << " must be 11" << endl;
  17.  
  18.     cout << "testing peek(), must return 11" << queue.peek() << endl;
  19.  
  20.     cout << "begining deque, from 11 to 1" << endl;
  21.  
  22.     for(int i = 0; i < 11; i++){
  23.         cout << queue.deque() << endl;
  24.     }
  25.  
  26.     cout << "end of deque" << endl;
  27.  
  28.     cout << "size = " << queue.size() << " must be 0" << endl;
  29.  
  30.     cout << "testing isEmpty(). value should be 1 -> " << queue.isEmpty() << endl;
  31.  
  32.     cout << "now it should throw error" << endl;
  33.  
  34.     cout << queue.deque();
  35.  
  36.     return 0;
  37. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top