Advertisement
Guest User

Untitled

a guest
May 27th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.68 KB | None | 0 0
  1.     long rozmiar = 1000;    //  liczność zbioru wejściowego
  2.     float stosunek = 1;     //  stosunek wyjęć do wstawień
  3.        
  4.     std::cout << "Rozmiar: " << rozmiar << "\n";
  5.        
  6.     for (int i = 1; i <= rozmiar; i++) {
  7.         a.setValue(gen.getRandom(0, 100));
  8.         theQueue.put(a);
  9.     }
  10.  
  11.     for (int i = 1; i <= rozmiar*stosunek ; i++) {
  12.         try {
  13.             theQueue.get();
  14.         }
  15.         catch (QueueException &exc) {
  16.             std::cout << "get: empty\n";
  17.         }
  18.     }
  19.  
  20.         std::cout << "Comparisons: " << SimpleObject<int>::getComparisons() << "\n";
  21.         std::cout << "Copyings: " << SimpleObject<int>::getCopyings() << "\n";
  22.        
  23.         return 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement