AP SCP Unit 6 AP classroom questions

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

A sorted list of numbers contains 500 elements. Which of the following is closest to the maximum number of list elements that will be examined when performing a binary search for a value in the list?

10

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?

8

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?

8

Consider the following algorithms. Each algorithm operates on a list containing n elements, where n is a very large integer. I. An algorithm that accesses each element in the list twice II. An algorithm that accesses each element in the list n times III. 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, II and III

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 not possible to create an algorithm that will solve the problem for all programs and inputs.

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, no algorithm can be written that is capable of providing a correct yes-or-no answer.

Which of the following best describes the ability of parallel computing solutions to improve efficiency?

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 explains the ability to solve problems algorithmically?

There exist some problems that cannot be solved algorithmically using any computer.

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?

There is no possible algorithm that can be used to solve all instances of the problem.

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?

Finding the fastest route that visits every location among nn locations, which requires n!n! possible routes be examined.

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?

15

Under which of the following conditions is it most beneficial to use a heuristic approach to solve a problem?

When the problem cannot be solved in a reasonable time and an approximate solution is acceptable

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.

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 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 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 might be improved by using a process that finds approximate solutions every time the computer-controlled player has a turn.

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 list must be sorted based on the genetic code values.


Kaugnay na mga set ng pag-aaral

AP English Semester 1 study guide

View Set

Biology 102 Exam 4 Practice Questions

View Set

English with Smiling Sam 3. Unit 6. Hello, spring! Easter

View Set

Physics 100 - Week 3: Knowledge Check

View Set

Ch. 16 Sex and Sexual Selection Homework

View Set