Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Sort and Search Evaluation - C++ You are to compare two sorting algorithms and compare two searching algorithms by running the algorithms and collecting data
Sort and Search Evaluation - C++ You are to compare two sorting algorithms and compare two searching algorithms by running the algorithms and collecting data on each. Your data for sorting and searching will be strings of 15 characters in length. You are to have your program run, compute, and print all the results in one run, not multiples runs. (You are to run your program once for all data sets). First part: The two sorts to compare are the Bubble Sort and the Selection Sort. You are to test your sorts against different sets of strings. Each sort will sort six sets of data, 1000 strings, 3000 strings, 5000, 7000, 9000, and 11000 strings. You will compare how well each sort did with the different data sizes and show results. I would like to see a plot of the results. A table format showing results will do. Use the 'time' function and the 'difftime' function to gather sorts times. Show your answers with at least 4 places to the right of the decimal point. Second part: The two searches to use for comparisons are the Linear Search and the Binary Search. You will search for 3000 random strings in the array of 11000 strings array only and compute the average number of probes (not time!) needed to find a match. The target string will be a randomly selected string from the 11000 string's data set. You will randomly select 3000 strings for testing each search algorithm. Output the average number of probes needed for each search algorithm. Third part: How does your two search algorithms compare with the theoretical values
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