Find Jobs
Hire Freelancers

C++ Sorting

$30-5000 USD

Completed
Posted almost 20 years ago

$30-5000 USD

Paid on delivery
The files sorts.h and [login to view URL] contain the function prototypes (with pre/post conditions) and function implementations respectively. The file, [login to view URL] is the driver file. **Problem** Code insertion sort, mergesort, heapsort, and quicksort using the pseudocode from the text, and run these sorts on two arrays as specified below. Time the sorts and create a table for the output that displays the actual times. Your times should be in seconds, accurate to at least three decimal places. DO NOT DISPLAY THE ARRAYS! Here are the problem specifications. 1. 2. 1. Display a menu that gives these choices. 1. 2. a. Run all sorts on a random array. 3. b. Run all sorts but insertion sort on a random array. 4. c. Run all sorts on a random array and a pre-sorted array (smallest to largest). 5. d. Run all sorts but insertion sort on a random array and a pre-sorted array. 6. e. Quit. 3. 2. Prompt the user to enter a number that represents the size of an array. 4. 3. Create an array of ints of the user-specified size. 5. 4. Populate the array with random ints in the range [1, 30000]. 6. 5. Run the menu option chosen in step 1 above. Be sure to run the all sorts on the same numbers and in the same order. 7. 6. Time the sorts and save the times. 8. 7. Display the results of your sorts in table format with the accuracy specified earlier. 9. 8. Re-display the menu from step 1. Here is an example of the expected output Sort Unsorted time Sorted time // Choice d from the menu ## Deliverables ------------------------------------------------------------------------ Mergesort 0.000 0.000 Heapsort 0.000 0.000 Quicksort 0.000 0.000 OR Sort Unsorted time // Choice b from the menu --------------------------------------- Mergesort 0.000 Heapsort 0.000 Quicksort 0.000 Notes 1. 2. 1. You may use the rand() function from <cstdlib> to generate your pseudorandom numbers. 3. 2. You may use the clock() function from <ctime> to help you generate clock times. 4. 3. You should use operators new and delete to allocate and deallocate your arrays. 5. 4. Each sort should sort the same numbers in the same order. 6. 5. Be sure to test your program using the g++ compiler before submitting. 7. 6. Be sure to use program style (pre/post, header comments, sparse code comments, self-documenting names, whitespace, indentation, etc.). Finally, are the results of your program what you expected? ## Platform Please feel free to contact me with any questions. **_The program must compile on a g++ compiler_**. **_THE DUE DATE FOR THIS IS SATURDAY JULY 10TH 2004._**
Project ID: 3269462

About the project

28 proposals
Remote project
Active 20 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
See private message.
$13 USD in 6 days
5.0 (36 reviews)
4.9
4.9
28 freelancers are bidding on average $34 USD for this job
User Avatar
See private message.
$42.50 USD in 6 days
5.0 (73 reviews)
6.6
6.6
User Avatar
See private message.
$42.46 USD in 6 days
5.0 (159 reviews)
6.0
6.0
User Avatar
See private message.
$8.50 USD in 6 days
4.9 (189 reviews)
6.1
6.1
User Avatar
See private message.
$85 USD in 6 days
4.9 (212 reviews)
5.8
5.8
User Avatar
See private message.
$42.50 USD in 6 days
5.0 (51 reviews)
5.3
5.3
User Avatar
See private message.
$42.50 USD in 6 days
4.9 (16 reviews)
4.6
4.6
User Avatar
See private message.
$11.05 USD in 6 days
4.7 (34 reviews)
4.9
4.9
User Avatar
See private message.
$38.25 USD in 6 days
4.9 (11 reviews)
4.1
4.1
User Avatar
See private message.
$12.75 USD in 6 days
5.0 (19 reviews)
3.5
3.5
User Avatar
See private message.
$21.25 USD in 6 days
4.0 (17 reviews)
4.4
4.4
User Avatar
See private message.
$21.25 USD in 6 days
5.0 (31 reviews)
3.7
3.7
User Avatar
See private message.
$63.75 USD in 6 days
5.0 (13 reviews)
2.7
2.7
User Avatar
See private message.
$12.75 USD in 6 days
5.0 (7 reviews)
2.4
2.4
User Avatar
See private message.
$17 USD in 6 days
5.0 (8 reviews)
2.4
2.4
User Avatar
See private message.
$25.50 USD in 6 days
4.9 (6 reviews)
2.3
2.3
User Avatar
See private message.
$34 USD in 6 days
4.9 (4 reviews)
1.9
1.9
User Avatar
See private message.
$36.55 USD in 6 days
4.7 (4 reviews)
1.1
1.1
User Avatar
See private message.
$17 USD in 6 days
3.5 (4 reviews)
0.8
0.8
User Avatar
See private message.
$25.50 USD in 6 days
0.0 (0 reviews)
0.0
0.0
User Avatar
See private message.
$51 USD in 6 days
0.0 (0 reviews)
0.0
0.0

About the client

Flag of UNITED STATES
Aurora, United States
4.8
27
Member since Oct 17, 2003

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.