Question: Implement the Hanoi Tower function that returns the sequence of commands to move n disks from pole A to pole C . We consider the

Implement the Hanoi Tower function that returns the sequence of commands to
move n disks from pole A to pole C.
We consider the class Array that you have created and we wish to insert
elements in the array. We consider 2 cases for the implementation of the insert
function
Case 1: Add 1 element in memory each time you insert a new element.
Case 2: Add a property capacity corresponding to the amount of elements that
have been allocated, and the size corresponds only to the number of elements
in the array. At each insert, if the capacity is full, then you double the size of the
array.
Add a property in your class to count how many times you copy an element, so you
can track the number of operations during your tests.
Using functions to measure the time. Compare the duration for inserting 10000
elements in the array. Repeat the operations 100 times, and report the mean and
standard deviation of the duration
Remarks: you can use an array to store the 100 measurements, and you should
implement the mean and standard deviation functions as well (search in Wikipedia
if you don't know the equation of the standard deviation).
Report the values that you have obtained directly in the code as comments, with
information about your machine (e.g. CPU).
do the following code in C++

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!