Question: c++ Write code that uses DynArr to allocate and insert a large number of elements into a DynArt object. Use std::clock to measure the time

c++
Write code that uses DynArr to allocate and insert a large number of elements into a DynArt object. Use std::clock to measure the time needed to insert 1000, 2000, 3000, 4000, 5000, 200000 elements into the DynArr object. Change the way the array is expanded and instead of doubling the capacity only increase the capacity by 10. Repeat measuring the time for 1000, 2000, ... 200000 insertions. What difference do you notice? Try to explain. Hint: try to chart the two sequences. Repeat the same exercise but now use the STL vector
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
