C++ Project, sorting methods?!

Nov 15th, 2013

Anonymous

Category:

Programming

Price: $10 USD

Question description

Okay so I am in a Data Structures class and I am completely stuck. I did the project it is just coming up with errors so can someone please help me with what i'm doing wrong!!the program should prompt the user to:• Have the user enter the number of items in the list you wish to sort.• Have the user enter the number of trials you wish to run.• Have the user enter the type of sort you wish to run. A menu of options would probably work best for this. It should provide the option of bubble sort, selection sort, merge sort, and quick sort.

The program should then run the requested number of trials on a list of the given size, then report the average amount of time it took to sort a single list of that size. For example, if the user wants a list size of 100 and a number of trial of 10, you should sort a 100 item list 10 times (make it a new randomized list each time!), then report the total time divided by the number of trials.

For example, a run of this program might look like this:Please enter the size of the list you wish to sort: 1000Please enter the number of trials to run: 100Please select a sort:1. Bubble sort2. Selection sort3. Merge sort4. Quick sortChoice: 1The average time to sort 1000 items using bubble sort is: 0.14 seconds