Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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;
int database new intsize
int database new intsize
delete the database as follows
delete database
database nullptr;
Orientation Assignment Overview
Create a class called Song Songh and Song.cpp which is defined by a title, singer and
chart position.
Create a dynamic array of pointers called dataArray to Song objects
Read in the song data from a file called SongsData.txt that contains songs which are
unsorted
Create a song object and save the pointer to this object in the dynamic array
Use the selection sort algorithm to sort this dataArray. Count the number of steps taken
to sort
Print the sorted array
Prompt the user for a song title
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 additional songs so total songs
Observer the number of steps for this dataset for steps and
Read through the orientation assignment document for detailed instructions including
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started