Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a project that analyzes the complexity of linear search and binary search using an empirical step count for each. Suggested array sizes will be

Create a project that analyzes the complexity of linear search and binary search using an empirical step count for each. Suggested array sizes will be 200, 400, 600, and 800. Create the arrays and assign randomized values for each element in the array. The randomized values should range from 1 to twice the size of the array. For example, for an array of 200, assign random values between 1 and 400. Use a constant for the size of the array. Edit the value of the constant in different runs of the program to account for the various array sizes. Perform a step count test for linear search. To get an appropriate average step count for linear search, run the search in a counting loop that executes 1000 times, and divide the total step count for all 1000 searches by 1000. Each call to the linear search function should use its own random value for the search parameter covering the appropriate range of each array. Display both the total step count of the 1000 linear searches and the average step count for linear search. Sort the array. Similarly perform and display the step count totals and average for binary search. You may use some of the code in LinearSearch.cpp and BinarySearch.cpp under our course Resources as a resource but be on the alert for any errors in these programs. When you display the arrays to demonstrate your work, display each value on its own line and show the index as a label for the elements value. For example, if the first element has a value of 39, display as follows: [0]: 39

Submit: Zipped project folder for investigating the step counts of each search. The project folder should be submitted in its own zipped project folder. Use only .zip folders (not .rar folder). An Excel spreadsheet showing how the growth of the data set (n) affects the number of steps that each algorithm takes. The data should be shown in table and chart displays. See Unit 2 Part 3 of CSC 231 Units. Copy and paste the output of your program showing the step count data for linear and binary search for each of the four sizes of the array.

C++ image text in transcribed
Project 1 Searching, Step Counts, and Big O Analysis This is an individual assignment. You will have lab time to work on this assignment as well as homework time. Create a project that analyzes the complexity of linear search and binary search using an empirical step count for cach. Suggested array sizes will be 200, 400, 600, and 800. Create the arrays and assign randomized values for each element in the array. The randomized values should range from 1 to twice the size of the array. For example, for an array of 200, assign random values between 1 and 400. Use a constant for the size of the array. Edit the value of the constant in different runs of the program to account for the various array sizes. Perform a step count test for linear search. To get an appropriate average step count for linear search, run the search in a counting loop that executes 1000 times, and divide the total step count for all 1000 searches by 1000. Each call to the linear search function should use its own random value for the search parameter covering the appropriate range of each array, Display both the total step count of the 1000 linear searches and the average step count for linear search. Sort the array. Similarly perform and display the step count totals and average for binary search. You may use some of the code in Lincar Scarch.cpp and Binary Search.cpp under our course Resources as a resource but be on the alert for any errors in these programs. When you display the arrays to demonstrate your work, display each value on its own line and show the index as a label for the element's value. For example, if the first element has a value of 39, display as follows: [0]: 39 Submit: 1. Zipped project folder for investigating the step counts of each search. The project folder should be submitted in its own zipped project folder. Use only.zip folders (not .rar folder). 2. An Excel spreadsheet showing how the growth of the data set (n) affects the number of steps that each algorithm takes. The data should be shown in table and chart displays. See Unit 2 Part 3 of CSC 231 Units. Copy and paste the output of your program showing the step count data for linear and binary search for each of the four sizes of the array. Project 1 Searching, Step Counts, and Big O Analysis This is an individual assignment. You will have lab time to work on this assignment as well as homework time. Create a project that analyzes the complexity of linear search and binary search using an empirical step count for cach. Suggested array sizes will be 200, 400, 600, and 800. Create the arrays and assign randomized values for each element in the array. The randomized values should range from 1 to twice the size of the array. For example, for an array of 200, assign random values between 1 and 400. Use a constant for the size of the array. Edit the value of the constant in different runs of the program to account for the various array sizes. Perform a step count test for linear search. To get an appropriate average step count for linear search, run the search in a counting loop that executes 1000 times, and divide the total step count for all 1000 searches by 1000. Each call to the linear search function should use its own random value for the search parameter covering the appropriate range of each array, Display both the total step count of the 1000 linear searches and the average step count for linear search. Sort the array. Similarly perform and display the step count totals and average for binary search. You may use some of the code in Lincar Scarch.cpp and Binary Search.cpp under our course Resources as a resource but be on the alert for any errors in these programs. When you display the arrays to demonstrate your work, display each value on its own line and show the index as a label for the element's value. For example, if the first element has a value of 39, display as follows: [0]: 39 Submit: 1. Zipped project folder for investigating the step counts of each search. The project folder should be submitted in its own zipped project folder. Use only.zip folders (not .rar folder). 2. An Excel spreadsheet showing how the growth of the data set (n) affects the number of steps that each algorithm takes. The data should be shown in table and chart displays. See Unit 2 Part 3 of CSC 231 Units. Copy and paste the output of your program showing the step count data for linear and binary search for each of the four sizes of the array

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

3. Describe the communicative power of group affiliations

Answered: 1 week ago