Commit 6a3d7fd0 authored by amitjans's avatar amitjans
Browse files

Add problem 2

parent 424e2674
......@@ -11,18 +11,24 @@ using test_type = unsigned long;
template <class C>
void fill_container(const size_t & num_ops, C & container) {
// TODO: implement
for(test_type i = 0; i < num_ops ; i++) {
container[i] = i + 1;
}
}
template<typename C>
double measure_container(const size_t & num_ops,
const std::vector<test_type> & input) {
// TODO: implement
for(test_type i = 0; i < num_ops; i++) {
}
Timer timer; // create timer object
// copy content of input in the container
C container(input.begin(), input.end());
timer.start();
for (size_t i = 0; i < num_ops; i++) {
container.insert(container.begin(), 0);
container.erase(container.begin());
}
timer.stop();
return timer.duration();
}
int main() {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment