Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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 class instead of Dynrr. Use the push_back method to insert the elements. Compare the behavior of the vector insertions with the DynArr (with double growth) insertions. Try to explain the difference in runtime behavior if any

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Oracle8I Building Efficient Databases

Authors: Jonathan Lewis

1st Edition

0201715848, 978-0201715842

More Books

Students also viewed these Databases questions