Collegeboard Test 4

Corrections

The correct asnwer is c- 80 seconds becasue one the processors would run y and z which would take 80 seconds

The correct asnwer is a- Each packet contains data to be transmitted, along with metadata containing information used for routing the data.

Option b is correct, the number of statements in a program is not likely to affect how a program will handle larger data sets. The efficiency of a program is independent of the number of statements it contains. There are some programs with very few statements that take a long time to execute, as well as programs with many statements that take little time to execute.

Option c is correct. By current standards, a single high school’s list of student grades is not considered a large set of data. Furthermore, identifying 10 students with the highest grade point averages is not an example of finding patterns.

Option c is correct. If a negative of the original image is made, each RGB triplet value will be computed by subtracting the original value from 255. The original value can then be restored by subtracting the new value from 255. This process is lossless because the exact original can be restored.

Option a is correct. The representation of sound as data involves the computational manipulation of information. For one copy of a song to have a lower sound quality than another copy, a lower ratio of bits per second must have been used.

Option b is correct. This code segment draws the three line segments shown in the figure. The first call to drawLine draws a line segment with endpoints (1, 5) and (6, 5). The second call to drawLine draws a line segment with endpoints (1, 5) and (6, 7). The third call to drawLine draws a line segment with endpoints (1, 5) and (6, 3).

Option a is correct. The binary search algorithm starts at the middle of the list and repeatedly eliminates half of the elements until the desired value is found or all elements have been eliminated. For listOne, the list will be cut in half a maximum of 9 times, with a total of 10 elements needing to be examined. The list will start with 700 elements, then will be reduced to 350 elements, then to 175 elements, then to 87 elements, then to 43 elements, then to 21 elements, then to 10 elements, then to 5 elements, then to 2 elements, and then, finally, to 1 element. For listTwo, the list will also be cut in half a maximum of 9 times, with a total of 10 elements needing to be examined. The list will start with 900 elements, then will be reduced to 450 elements, then to 225 elements, then to 112 elements, then to 56 elements, then to 28 elements, then to 14 elements, then to 7 elements, then to 3 elements, and then, finally, to 1 element.

Option b is correct. Algorithm I does not work correctly. In algorithm I, if two people are tied for the earliest birthday, they both sit down when they are eventually paired. Algorithm II works correctly. Because algorithm II allows both people to remain standing when there is a tie, a person with the earliest birthday is not eliminated. Algorithm II continues until all remaining people have the same birthday, which is the earliest birthday. Algorithm III does not work correctly. Algorithm III chooses the person(s) with the earliest day, disregarding the month. For example, algorithm III will incorrectly determine that a person born on February 1 has an earlier birthday than a person born on January 5.