Font size
Worksheetsqiuz
Total questions: 54
Worksheet time: 28mins
Which of the following best explains the ability to solve problems algorithmically?
Any problem can be solved algorithmically, though some algorithmic solutions may require humans to validate the results.
Any problem can be solved algorithmically, though some algorithmic solutions must be executed on multiple devices in parallel.
Any problem can be solved algorithmically, though some algorithmic solutions require a very large amount of data storage to execute.
There exist some problems that cannot be solved algorithmically using any computer.
Which of the following best describes the ability of parallel computing solutions to improve efficiency?
Any problem that can be solved sequentially can be solved using a parallel solution in approximately half the time.
Any solution can be broken down into smaller and smaller parallel portions, making the improvement in efficiency theoretically limitless as long as there are enough processors available.
The efficiency of parallel computing solutions is rarely improved over the efficiency of sequential computing solutions
The efficiency of a solution that can be broken down into parallel portions is still limited by a sequential portion.
Which of the following best describes a challenge involved in using a parallel computing solution?
A parallel computing solution may not be appropriate for an algorithm in which each step requires the output from the preceding step.
A parallel computing solution may not be appropriate for an algorithm in which the same formula is applied to many numeric data elements.
A parallel computing solution may not be appropriate for an algorithm that can be easily broken down into small independent tasks.
For which of the following situations would it be best to use a heuristic in order to find a solution that runs in a reasonable amount of time?
Appending a value to a list of n elements, which requires no list elements be examined
Finding the fastest route that visits every location among n locations, which requires n! possible routes be examined.
Performing a binary search for a score in a sorted list of n scores, which requires that fewer than n scores be examined.
The figure below shows four grids, each containing a robot represented as a triangle. The robot cannot move to a black square or move beyond the edge of the grid.
Step 1:
Keep moving forward, one square at a time, until the square to the right of the robot is black.
Step 2:
Turn right and move one square forward.
Step 3:
Repeat steps 1 and 2 three more times.
Step 1:
Keep moving forward, one square at a time, until the square to the right of the robot is no longer black.
Step 2:
Turn right and move one square forward.
Step 3: Repeat steps 1 and 2 three more times.
Step 1:
Move forward three squares.
Step 2:
Turn right and move one square forward.
Step 3: If the square to the right of the robot is black, repeat steps 1 and 2.
Three different numbers need to be placed in order from least to greatest. For example, if the numbers are ordered 9, 16, 4, they should be reordered as 4, 9, 16. Which of the following algorithms can be used to place any three numbers in the correct order?
If the first number is greater than the last number, swap them. Then, if the first number is greater than the middle number, swap them.
If the first number is greater than the middle number, swap them. Then, if the middle number is greater than the last number, swap them.
If the first number is greater than the middle number, swap them. Then, if the middle number is greater than the last number, swap them. Then, if the first number is greater than the last number, swap them.
If the first number is greater than the middle number, swap them. Then, if the middle number is greater than the last number, swap them. Then, if the first number is greater than the middle number, swap them.
A program is used to assign processes to each of the processors. Which of the following describes how the program should assign the four processes to optimize execution time?
Processes W and X should be assigned to one processor, and processes Y and Z should be assigned to the other processor.
Processes W and Y should be assigned to one processor, and processes X and Z should be assigned to the other processor.
Processes W and Z should be assigned to one processor, and processes X and Y should be assigned to the other processor.
Under which of the following conditions is it most beneficial to use a heuristic approach to solve a problem?
When the problem can be solved in a reasonable time and an approximate solution is acceptable
When the problem can be solved in a reasonable time and an exact solution is needed
When the problem cannot be solved in a reasonable time and an approximate solution is acceptable
When the problem cannot be solved in a reasonable time and an exact solution is needed
A sorted list of numbers contains 200 elements. Which of the following is closest to the maximum number of list elements that will need to be examined when performing a binary search for a particular value in the list?
5
8
100
200
A sorted list of numbers contains 200 elements. Which of the following is closest to the maximum number of list elements that will need to be examined when performing a binary search for a particular value in the list?
10
50
250
500
A sorted list of numbers contains 128 elements. Which of the following is closest to the maximum number of list elements that can be examined when performing a binary search for a value in the list?
2
8
64
128
A time stamp indicates the date and time that a measurement was taken. A data scientist has a list containing 10,000 time stamps, sorted in chronological order. Which of the following is closest to the maximum number of values that will need to be examined when performing a binary search for a value in the list?
10
15
5000
10000
The list listOne is a sorted list of numbers that contains 700 elements. The list listTwo is a sorted list of numbers that contains 900 elements. Let x represent the maximum number of list elements that will need to be examined when performing a binary search for a value inlistOne, and let y represent the maximum number of list elements that will need to be examined when performing a binary search for a value in listTwo. Which of the following statements about xand y is true?
The value of x is approximately equal to the value of y.
The value of x is approximately 10 less than the value of y.
The value of x is approximately 13 less than the value of y.
Which of the following code segments will move the robot from the center square along the same path as the code segment above?
A
count ← 0
REPEAT 4 TIMES
{
count ← count + 1
REPEAT count TIMES
{
MOVE_FORWARD()
}
ROTATE_LEFT()
}
count ← 0
REPEAT 4 TIMES
{
count ← count + 1
ROTATE_LEFT()
REPEAT count TIMES
{
MOVE_FORWARD()
}
}
At the end of which of the following code segments is the value of sum the same as the value of sum at the end of the preceding code segment?
Select two answers.
sum ← 0
z ← x + y
REPEAT z TIMES
{
sum ← sum + 1
}
sum ← 0
z ← x * y
REPEAT z TIMES
{
sum ← sum + 1
}
sum ← 0
REPEAT x TIMES
{
sum ← sum + 1
}
REPEAT y TIMES
{
sum ← sum + 1
}
sum ← 0
REPEAT y TIMES
{
REPEAT x TIMES
{
sum ← sum + 1
}
}
Which of the following best compares the execution times of the two versions of the program?
Version I requires approximately 1 more minute to execute than version II.
Version II requires approximately 1 more minute to execute than version I.
Version II requires approximately 5 more minutes to execute than version I.
Which of the following best compares the values displayed by programs A and B?
Program A and program B display identical values in the same order.
Program A and program B display the same values in different ord
Program A and program B display the same number of values, but the values differ.
Which of the following best describes the two code segments?
Code segment I displays the correct average, but code segment II does not.
Code segment II displays the correct average, but code segment I does not.
Both code segments display the correct average, but code segment I requires more arithmetic operations than code segment II.
Both code segments display the correct average, but code segment II requires more arithmetic operations than code segment I.
Which of the following changes will NOT affect the results when the code segment is executed?
Changing line 3 to B-10
Changing line 3 to A-b+10
A programmer is deciding between using a linear or binary search to find a target value in a sorted list. Which of the following is true?
In all cases, a binary search of a sorted list requires fewer comparisons than a linear search.
Generally, the advantage of using a binary search over a linear search increases as the size of the list increases.
A linear search will generally run faster than a binary search because a linear search requires fewer lines of code to implement.
Which of the following best compares the values displayed by programs A and B?
Program A and program B display identical values.
Program A and program B display the same values in different orders.
Program A and program B display the same number of values, but the values differ.
Program A and program B display a different number of values.
Which of the following statements is true?.
Program I correctly moves the robot to the gray square, but program II does not.
Program II correctly moves the robot to the gray square, but program I does not.
Both program I and program II correctly move the robot to the gray square.
Neither program I nor program II correctly moves the robot to the gray square.
Which of the following best describes the behavior of the two programs?
Program I displays the correct sum, but program II does not.
Program II displays the correct sum, but program I does not.
Both program I and program II display the correct sum.
certain computer game is played between a human player and a computer-controlled player. Every time the computer-controlled player has a turn, the game runs slowly because the computer evaluates all potential moves and selects the best one. Which of the following best describes the possibility of improving the running speed of the game?
The game’s running speed can only be improved if the game is played between two human players instead of with the computer-controlled player.
The game’s running speed might be improved by using a process that finds approximate solutions every time the computer-controlled player has a turn.
The game’s running speed cannot be improved because computers can only be programmed to find the best possible solution.
The game’s running speed cannot be improved because the game is an example of an algorithm that does not run in a reasonable time.
A team of programmers is designing software. One portion of the project presents a problem for which there is not an obvious solution. After some research, the team determines that the problem is undecidable. Which of the following best explains the consequence of the problem being undecidable?
The problem can be solved algorithmically, but it will require an unreasonably long amount of time.
The problem can be solved algorithmically, but it will require an unreasonably large amount of data storage.
There is no possible algorithm that can be used to solve all instances of the problem.
There are several different possible algorithms that can solve the problem, but there is controversy about which is the most efficient.
Which of the following statements best describes the correctness of the programs?
Program I correctly moves the robot to the gray square, but program II does not.
Program II correctly moves the robot to the gray square, but program I does not.
Both program I and program II correctly move the robot to the gray square.
Neither program I nor program II correctly moves the robot to the gray square.
Which of the following best describes the behavior of the program?
The program correctly displays the number of times target appears in the list.
The program does not work as intended when target does not appear in the list.
The program does not work as intended when target appears in the list more than once.
The program does not work as intended when target appears in the list more than once.
A student wants to determine whether a certain problem is undecidable. Which of the following will demonstrate that the problem is undecidable?
Show that for one instance of the problem, an algorithm can be written that is always capable of providing a correct yes-or-no answer.
Show that for one instance of the problem, no algorithm can be written that is capable of providing a correct yes-or-no answer.
Show that for one instance of the problem, a heuristic is needed to write an algorithm that is capable of providing a correct yes-or-no answer.
Show that for one instance of the problem, an algorithm that runs in unreasonable time can be written that is capable of providing a correct yes-or-no answer.
Which of the following best approximates the difference in execution time between running the two processes in parallel instead of running them one after the other on a single processor?
15 sec
30 sec
45 sec
75 sec
A graphic artist uses a program to draw geometric shapes in a given pattern. The program uses an algorithm that draws the shapes based on input from the artist. The table shows the approximate number of steps the algorithm takes to draw different numbers of shapes.
The algorithm runs in a reasonable amount of time because it will use approximately n steps to draw n shapes.
The algorithm runs in a reasonable amount of time because it will use approximately n2 steps to draw n shapes.
The algorithm runs in an unreasonable amount of time because it will use approximately n2 steps to draw n shapes.
Which of the following best categorizes algorithm II?
Algorithm II attempts to use an algorithmic approach to solve an otherwise undecidable problem.
Algorithm II uses a heuristic approach to provide an approximate solution in reasonable time.
Algorithm II provides no improvement over algorithm I because neither algorithm runs in reasonable time.
Algorithm II requires a much faster computer in order to provide any improvement over algorithm I.
Which of the following best explains why it is not possible to use computers to solve every problem?
Current computer processing capabilities cannot improve significantly.
Large-scale problems require a crowdsourcing model, which is limited by the number of people available to work on the problem.
The ability of a computer to solve a problem is limited by the bandwidth of the computer’s Internet connection.
There exist some problems that cannot be solved using any algorithm.
Which of the following statements is equivalent to the algorithm in the flowchart?
For which of the following lists can a binary search be used to search for an item in the list?
["blue", "green", "jade", "mauve", "pink"]
[5, 5, 5, 5, 6, 7, 8, 8, 8]
[10, 5, 3, 2, -4, -8, -9, -12]
I only
III only
I and III only
I, II, and III
Which of the following best explains how algorithms that run on a computer can be used to solve problems?
All problems can be solved with an algorithm that runs in a reasonable amount of time.
All problems can be solved with an algorithm, but some algorithms might need a heuristic to run in a reasonable amount of time.
All problems can be solved with an algorithm, but some algorithms might run in an unreasonable amount of time.
Some problems cannot be solved by an algorithm.
Which of the following code segments is equivalent to the code segment above?
IF(num < 0)
{
DISPLAY("negative")
}
ELSE
{
DISPLAY("positive")
}
IF(num = 0)
{
DISPLAY("zero")
}
IF(num < 0)
{
DISPLAY("negative")
}
ELSE
{
IF(num = 0)
{
DISPLAY("zero")
}
ELSE
{
DISPLAY("positive")
}
}
IF(num ≤ 0)
{
DISPLAY("negative")
}
ELSE
{
IF(num = 0)
{
DISPLAY("zero")
}
ELSE
{
DISPLAY("positive")
}
}
A student wants to create an algorithm that can determine, given any program and program input, whether or not the program will go into an infinite loop for that input.
The problem the student is attempting to solve is considered an undecidable problem. Which of the following is true?
It is possible to create an algorithm that will solve the problem for all programs and inputs, but the algorithm can only be implemented in a low-level programming language.
It is possible to create an algorithm that will solve the problem for all programs and inputs, but the algorithm requires simultaneous execution on multiple CPUs.
It is possible to create an algorithm that will solve the problem for all programs and inputs, but the algorithm will not run in reasonable time.
It is not possible to create an algorithm that will solve the problem for all programs and inputs.
Which of the following best approximates the minimum possible time to execute all three processes when the two processors are run in parallel?Which of the following best approximates the minimum possible time to execute all three processes when the two processors are run in parallel?Which of the following best approximates the minimum possible time to execute all three processes when the two processors are run in parallel?
60 sec
70 sec
80 sec
90 sec
Which of the following parallel computing solutions would minimize the amount of time it takes to execute all four processes?
Running processes P and Q on one processor and processes R and S on the other processor
Running processes P and R on one processor and processes Q and S on the other processor
Running processes P and S on one processor and processes Q and R on the other processor
Running process P on one processor and processes Q, R, and S on the other processor
Consider the goal of modifying the code segment to count the number of squares the robot visits before execution terminates. Which of the following modifications can be made to the code segment to correctly count the number of squares the robot moves to?
Inserting the statement count ← count + 1 between line 6 and line 7
Inserting the statement count ← count + 2 between line 6 and line 7
Inserting the statement count ← count + 1 between line 8 and line 9
When the robot reaches the gray square, it turns around and faces the bottom of the grid. Which of the following changes, if any, should be made to the code segment to move the robot back to its original position in the bottom-left square of the grid and facing toward the bottom of the grid?
Interchange the ROTATE_RIGHT and the ROTATE_LEFT blocks.
Replace ROTATE_RIGHT with ROTATE_LEFT.
No change is needed; the algorithm is correct as is.
Which of the following expressions represents the value stored in the variable x as a result of executing the program?
2 3 3 * 3
2 4 4 * 4
2 3 3 3 3
Which of the following can be used to replace so that the procedure works as intended?
I’m
Which of the following programs is most likely to benefit from the use of a heuristic?
A program that calculates a student’s grade based on the student’s quiz and homework scores
A program that encrypts a folder of digital files
A program that finds the shortest driving route between two locations on a map
Consider the following algorithms. Each algorithm operates on a list containing n elements, where nis a very large integer.
An algorithm that accesses each element in the list twice
An algorithm that accesses each element in the list n times
An algorithm that accesses only the first 10 elements in the list, regardless of the size of the list
Which of the algorithms run in reasonable time?
I only
I and II only
I, II, and III
The programmer wants to reduce the number of operations that are performed when the program is run. Which change will result in a correct program with a reduced number of operations performed?
Interchanging line 1 and line 2
Interchanging line 5 and line 6
Interchanging line 6 and line 7
Interchanging line 7 and line 8
The procedure BinarySearch (numList, target) correctly implements a binary search algorithm on the list of numbers numList. The procedure returns an index where target occurs in numList, or -1 if target does not occur in numList. Which of the following conditions must be met in order for the procedure to work as intended?
The length of numList must be even.
The list numList must not contain any duplicate values.
The values in numList must be in sorted order.
The value of target must not be equal to -1.
Based on the values in the table, which of the following best characterizes the algorithm for very large values of n ?
The algorithm runs in reasonable time.
The algorithm runs, but not in reasonable time.
The algorithm attempts to solve an undecidable problem.
The algorithm attempts to find an approximate solution whenever it fails to find an exact solution.
Which of the following code segments produce the same result as the statement above for all possible values of val1 and val2 ?
Select two answers.Which of the following code segments produce the same result as the statement above for all possible values of val1 and val2 ?
Select two answers.
A large number of genetic codes are stored as binary values in a list. Which one of the following conditions must be true in order for a researcher to obtain the correct result when using a binary search algorithm to determine if a given genetic code is in the list?
The genetic codes must be converted from binary to decimal numbers.
The list must be sorted based on the genetic code values.
The number of genetic code values in the list must be a power of 2.
Which of the following best approximates the amount of time it takes the program to execute?
1h
2h
4h
5h
Which of the following statements is true?
Every problem can be solved with an algorithm for all possible inputs, in a reasonable amount of time, using a modern computer.
Every problem can be solved with an algorithm for all possible inputs, but some will take more than 100 years, even with the fastest possible computer.
There exist problems that no algorithm will ever be able to solve for all possible inputs.
Based on the values in the table, which of the algorithms appear to run in reasonable time?
Select two answers.
A
B
C
D
Suppose that a list of numbers contains values [-4, -1, 1, 5, 2, 10, 10, 15, 30]. Which of the following best explains why a binary search should NOT be used to search for an item in this list?
The list contains both positive and negative elements.
The elements of the list are not sorted.
The list contains an odd number of elements.
