SHARE
TWEET

Untitled

a guest Aug 25th, 2019 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include "simpio.h"
  3. #include "console.h"
  4. #include "MyQueue.h"
  5.  
  6. using namespace std;
  7.  
  8. int main(){
  9.     MyQueue queue;
  10.  
  11.     for(int i = 1; i < 12; i++){
  12.         queue.enque(i);
  13.     }
  14.  
  15.     cout << "size = " << queue.size() << " must be 11" << endl;
  16.  
  17.     cout << "testing peek(), must return 11" << queue.peek() << endl;
  18.  
  19.     cout << "begining deque, from 11 to 1" << endl;
  20.  
  21.     for(int i = 0; i < 11; i++){
  22.         cout << queue.deque() << endl;
  23.     }
  24.  
  25.     cout << "end of deque" << endl;
  26.  
  27.     cout << "size = " << queue.size() << " must be 0" << endl;
  28.  
  29.     cout << "testing isEmpty(). value should be 1 -> " << queue.isEmpty() << endl;
  30.  
  31.  
  32.     for(int i = 0; i < 110; i++){
  33.         queue.enque(i);
  34.     }
  35.  
  36.     for(ont i = 0; i< 110; i++){
  37.         queue.deque();
  38.     }
  39.  
  40.  
  41.     cout << "now it should throw error" << endl;
  42.  
  43.     cout << queue.deque();
  44.  
  45.     return 0;
  46. }
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
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top