Search Header Logo
AP CSP Unit 6 Review 1

AP CSP Unit 6 Review 1

Assessment

Presentation

Science, Computers

9th - 12th Grade

Practice Problem

Medium

NGSS
3-5-ETS1-1, 3-5-ETS1-2

Standards-aligned

Created by

Ruth Page

Used 366+ times

FREE Resource

1 Slide • 18 Questions

1

AP CSP Unit 6 Review

Algorithms

Slide image

2

Multiple Select

What does an algorithm need to be (choose all that apply)?

1

Clear instructions

2

Accurate

3

Easy to understand

4

Complex

3

Multiple Choice

Which of the following is an example of the use of heuristics?

1

Trying every possible combination of letters when unscrambling a word

2

Considering each possible move when playing chess

3

Using the formula “area=length x width” to find the area of a rectangle

4

Playing chess using a defensive strategy that has often been successful for you

4

Multiple Choice

A binary search is to be performed on the list:

3, 5, 9, 10, 23


How many comparisons would it take to find the number 9?

1

1

2

3

3

4

4

It can't find the number 9

5

Multiple Choice

A linear search is to be performed on the list:

12, 6, 8, 1, 3


How many comparisons would it take to find the number 1?

1

1

2

2

3

3

4

4

6

Multiple Choice

Identify the description of a binary search.

1

Put the elements in order, check each item in turn

2

Order elements,compare middle value,split list in order&loop

3

Elements do not need to be in order, check each item in turn

4

Randomize data, compare middle value, split list in order & loop

7

Multiple Choice

Identify the description of a linear search.

1

Put the elements in order, check each item in turn

2

Order elements,compare middle value,split list in order&loop

3

Elements do not need to be in order, check each item in turn

4

Randomize data, compare middle value, split list in order & loop

8

Multiple Choice

What is the largest number of comparisons needed to perform a binary search on an array with 42 elements?

1

2

2

5

3

6

4

41

5

42

9

Multiple Choice

We are searching for a number key in a sorted list that has n elements. Under what circumstances will Linear Search / Sequential Search be more efficient than Binary Search?

1

key is the last element in the array

2

key is in the middle of the array

3

n is very large

4

key is the first element in the array

5

key does not exist in the array

10

Multiple Choice

A robot is programming a new game called “Open the box!” You give him a number and he tries to open a numbered box. He’s using Binary Search to accomplish this. Unfortunately, the boxes are not sorted. They are in the following order:


1, 3, 6, 9, 14, 10, 21


Which box can NEVER be found using binary search?

1

9

2

6

3

14

4

10

11

Multiple Choice

Given this array:


1, 2, 4, 5, 6, 7, 8, 12, 14, 21, 22, 42, 53


How many comparisons are required to find 42 using the Linear Search / Sequential Search?

1

3

2

2

3

12

4

5

12

Multiple Choice

Given this list:


1, 2, 4, 5, 6, 7, 8, 12, 14, 21, 22, 42, 53


How many comparisons are required to find 42 using the Binary Search?

1

3

2

2

3

10

4

5

13

Multiple Choice

True or false: If an array is already sorted, Linear Search / Sequential Search is more efficient than Binary Search.

1

True

2

False

14

Multiple Choice

What must be true before performing a binary search?

1

The elements must be sorted.

2

It can only contain binary values.

3

The elements must be some sort of number (i.e. int, double, Integer)

4

There are no necessary conditions.

15

Multiple Choice

Question image

You are at the yellow arrow, pointing in the direction indicated. How would you move to fill in the 2 black squares?

1

Straight x 1, Turn right, Straight x 1, Fill Square, Straight x 2, Turn left, Straight x 1, Fill Square

2

Straight x 2, Turn right, Straight x 1, Fill Square, Straight x 2, Turn left, Straight x 1, Fill Square

3

Straight x 2, Turn right, Straight x 1, Fill Square, Straight x 2, Turn right, Straight x 1, Fill Square

4

Straight x 2, Turn right, Straight x 1, Fill Square, Straight x 2, Turn left, Straight x 2, Fill Square

16

Multiple Select

What's the difference between a flow chart and pseudocode? (choose all that apply)

1

Nothing

2

Flow chart uses symbols

3

Pseudocode is more colorful

4

Flow chart has data flow arrows

5

Pseudocode and flow charts both use arrows for data flow

17

Multiple Choice

Question image

If it is AFTER 7am, what do you need to do?

1

Take the bus

2

Take the subway

3

Check the time

4

Leave home

18

Multiple Choice

Which of these does NOT represent an algorithm?

1

Following recipe instructions

2

Working out how an engine works

3

Tying your shoelaces

4

Making a cup of coffee

19

Multiple Choice

What is one purpose of pseudocode?

1

To program a computer

2

So we can see the different symbols

3

It helps us with the variables

4

It helps us plan the code

5

Flow charts are helpful to us when planning

AP CSP Unit 6 Review

Algorithms

Slide image

Show answer

Auto Play

Slide 1 / 19

SLIDE