BHCSI Algorithms Homework Assignment #2: Bucket Sort Assigned: Thursday 7/11/02

advertisement
BHCSI Algorithms
Homework Assignment #2: Bucket Sort
Assigned: Thursday 7/11/02
Due: Friday 7/12/02 (when lab starts)
In this assignment you will implement the Bucket sort algorithm in C++. You will sort a
list of numbers in ascending order. Create TOTAL number of random numbers in
between 1 and 30000 to sort, where TOTAL is a constant in your program. Print out to a
file the unsorted values, one number on a line followed by the sorted values, one number
on a line. Here is a sample of how your output file should look:
List of unsorted values:
25341
10234
8274
13333
21223
29411
These values sorted:
8274
10234
13333
21223
25341
29411
Prompt the user for the name of the output file and let them enter this file name. You may
assume the user enters a valid output file, so no need to do any error checking.
Download