Question: Dynamic Array Notes Dynamic Arrays are created on the heap. They can be de allocated or deleted after use The size of the array can

Dynamic Array Notes
Dynamic Arrays are created on the heap.
They can be de allocated or deleted after use
The size of the array can be provided at run time.
Once created, the size is fixed but using dynamic arrays is needed for dynamically
increasing storage space of a database.
eg. int size=10;
int * database = new int[size]
int ** database = new int*[size]
delete the database as follows
delete [] database
database = nullptr;
Orientation Assignment Overview
1. Create a class called Song (Song.h and Song.cpp) which is defined by a title, singer and
chart position.
2. Create a dynamic array of pointers (called dataArray) to Song objects
3. Read in the song data from a file called SongsData.txt that contains 100 songs which are
unsorted
4. Create a song object and save the pointer to this object in the dynamic array
5. Use the selection sort algorithm to sort this dataArray. Count the number of steps taken
to sort
6. Print the sorted array
7. Prompt the user for a song title
8. Perform a linear search through the dataArray and count the number of steps taken for
this search
Run the program one more time, this time with the datafile called SongsDataDouble.txt
which contains 100 additional songs (so total 200 songs).
Observer the number of steps for this dataset for steps 5 and 8.
Read through the orientation assignment document for detailed instructions including

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!