Question
Your C++ program will sort and provide time comparisons (using the high resolution clock class) for the first 5000 and 10000 words from books of
-
Your C++ program will sort and provide time comparisons (using the high resolution clock class) for the first 5000 and 10000 words from books of literature
-
Locate text files of at least 2 works of literature. These are your data files. (Different text files are expected from each student.) Allow the user the choice of which book they would like to use as the sample.
-
Implement sort algorithms with 2 efficiency of O(n2)and 2 sort algorithms with efficiency of O(n log n).
-
Allow user to choose 5000 or 10000 sample size.
-
Parse words from your chosen books to fill an array of the the chosen sample size. Be
sure to clean up your data as needed.
-
Sort the list of words alphabetically and time each sort.
-
Run each sort algorithm at least 5 times to sort unsorted data. Measure the times for
each sort. Provide the user with these sort times for each algorithm in a table-like
column format for easy readability.
-
Run each sort also against a sorted list and provide times.
-
The user should be informed of all the significant step in your program ,i.e.,output a
statement such as Program start ...., Reading word list from file...., etc.
-
Allow the user to choose to see the first 100 words on the list or the last 100 words on
the list.
-
Allow the user to repeat or quit.
-
Be prepared to discuss all the time data in your report. All time measurements should
only include time to search, and not include other times like reading from text files, parsing, loading into array, etc.
-
Be sure that your program is well written, includes at least 4 meaningful functions outside of main, and is effectively documented in header and throughout. The program must use function declarations with function definitions after main(). Use only local variables. The C++ library function random_shuffle may be helpful.
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