DynamicArrayCounter.cpp 411 Bytes
Newer Older
Christophe Rhodes's avatar
Christophe Rhodes committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <vector>
#include <iostream>

#include "DynamicArray.hpp"
#include "OpCounter.hpp"

int main(int argc, char *argv[]) {
  std::vector<int> l = {1, 5, 10, 50, 100, 500, 1000};
  for (int i = 0; i < l.size(); i++) {
    DynamicArray *a = new DynamicArray(5);
    for(int n = 0; n < l[i]; n++) {
      a->push(n);
    }
    std::cout << l[i] << "," << a->counter.report() << std::endl;
    delete a;
  }
}