Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Does anyone know what to do LAB EXPERIENCE 3 : SEARCH FOR LARGEST VALUE ALGORITHM Data Set 1: Data Set 6: Positions: Positions: OPEN THE

Does anyone know what to do

image text in transcribedimage text in transcribed

LAB EXPERIENCE 3 : SEARCH FOR LARGEST VALUE ALGORITHM Data Set 1: Data Set 6: Positions: Positions: OPEN THE SEARCH ANIMATOR IN YOUR INVITATION TO CS SOFTWARE AND USE THE SEARCH FOR LARGEST ALGORITHM. Values: Values: Data Set 2: Data Set 7: 1. Stepping Positions: Positions: Values: Values: If necessary, open the Search Animator and select the Search for Largest algorithm in the Select Algorithm drop-down list. Use the Step button to execute the algorithm two or three times until you understand exactly how the algorithm works and how the animation corresponds to the steps in the pseudocode window. Remember to click Reset when you are ready to start over with a new set of data. Briefly describe how the algorithm works. Data Set 3: Data Set 8: Positions: Positions: Values: Values: Data Set 4: Data Set 9: Positions: Positions: 2. How many positions does the location marker achieve? Values: Values: Observe that with the eight pieces of data, there are always seven passes through the loop (n - 1 if there were n pieces of data). However, the number of positions that the location marker takes on (Step 7) depends on the relative order of the data. Data Set 5: Data Set 10: Positions: Positions: You will now make use of the animator to explore this dependence in more depth. Using the step mode, gather data from 10 executions of the algorithm (See table below) and enter the results in your document. Values: Values: For each data set, copy down the entire data set and keep up with the position of the location marker and the data value at that position each time the location marker moves For example, if the data set were 20, 15, 25, 30, 42, 18, 72, 11, then you would copy the entire list as the data set. The original position of the location marker would be position 1, and the value at that position is 20. Therefore, you would enter 1 for the location and 20 for the value. When the location marker moves, list the location number that the marker moves to and the data value there. Continue until the algorithm terminates 3. Determining the values at the location marker by scanning Look at the data obtained in Exercise 3.2. Notice that the values stored at the positions taken on by the location marker form a subsequence of the original data set; that is, the values of the subset are taken from the original set in the same relative order as in the original set. Explain in your own words how to scan the list from left to right and pick out the values that will be in this subsequence. Once you are sure of how this works, it is fine just to click Reset and copy the relevant data down without stepping through the entire execution (just be sure that you know what will happen). 4. Smallest number of positions for the location marker What would be the smallest number of positions that location marker could possibly point to during the execution of the algorithm? Describe the special conditions under which this would happen. Approximately how often would you expect this to occur? 5. Largest number of positions for the location marker What would be the largest number of positions that the location marker could possibly point to during the execution of the algorithm? Describe the conditions under which this would happen. Approximately how often would you expect this to occur? 6. Likelihood of many positions for the location marker How would you compare the likelihood that the location marker would point to three different positions (just a few times) versus the likelihood that the location marker would point to seven different positions (many times)? Would you expect the likelihood that the location marker points to three different positions to be much smaller, about the same, or much larger than the likelihood that it would point to seven different positions? LAB EXPERIENCE 3 : SEARCH FOR LARGEST VALUE ALGORITHM Data Set 1: Data Set 6: Positions: Positions: OPEN THE SEARCH ANIMATOR IN YOUR INVITATION TO CS SOFTWARE AND USE THE SEARCH FOR LARGEST ALGORITHM. Values: Values: Data Set 2: Data Set 7: 1. Stepping Positions: Positions: Values: Values: If necessary, open the Search Animator and select the Search for Largest algorithm in the Select Algorithm drop-down list. Use the Step button to execute the algorithm two or three times until you understand exactly how the algorithm works and how the animation corresponds to the steps in the pseudocode window. Remember to click Reset when you are ready to start over with a new set of data. Briefly describe how the algorithm works. Data Set 3: Data Set 8: Positions: Positions: Values: Values: Data Set 4: Data Set 9: Positions: Positions: 2. How many positions does the location marker achieve? Values: Values: Observe that with the eight pieces of data, there are always seven passes through the loop (n - 1 if there were n pieces of data). However, the number of positions that the location marker takes on (Step 7) depends on the relative order of the data. Data Set 5: Data Set 10: Positions: Positions: You will now make use of the animator to explore this dependence in more depth. Using the step mode, gather data from 10 executions of the algorithm (See table below) and enter the results in your document. Values: Values: For each data set, copy down the entire data set and keep up with the position of the location marker and the data value at that position each time the location marker moves For example, if the data set were 20, 15, 25, 30, 42, 18, 72, 11, then you would copy the entire list as the data set. The original position of the location marker would be position 1, and the value at that position is 20. Therefore, you would enter 1 for the location and 20 for the value. When the location marker moves, list the location number that the marker moves to and the data value there. Continue until the algorithm terminates 3. Determining the values at the location marker by scanning Look at the data obtained in Exercise 3.2. Notice that the values stored at the positions taken on by the location marker form a subsequence of the original data set; that is, the values of the subset are taken from the original set in the same relative order as in the original set. Explain in your own words how to scan the list from left to right and pick out the values that will be in this subsequence. Once you are sure of how this works, it is fine just to click Reset and copy the relevant data down without stepping through the entire execution (just be sure that you know what will happen). 4. Smallest number of positions for the location marker What would be the smallest number of positions that location marker could possibly point to during the execution of the algorithm? Describe the special conditions under which this would happen. Approximately how often would you expect this to occur? 5. Largest number of positions for the location marker What would be the largest number of positions that the location marker could possibly point to during the execution of the algorithm? Describe the conditions under which this would happen. Approximately how often would you expect this to occur? 6. Likelihood of many positions for the location marker How would you compare the likelihood that the location marker would point to three different positions (just a few times) versus the likelihood that the location marker would point to seven different positions (many times)? Would you expect the likelihood that the location marker points to three different positions to be much smaller, about the same, or much larger than the likelihood that it would point to seven different positions

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