Answered step by step
Verified Expert Solution
Link Copied!

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=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

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

Step: 3

blur-text-image

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

Development Of Knowledge Framework For Affective Content Analysis

Authors: Swarnangini Sinha

1st Edition

B0CQJ13WZ1, 979-8223977490

More Books

Students also viewed these Databases questions

Question

What is the number-one rule in making an investor presentation?

Answered: 1 week ago