Search Header Logo

C++ Quiz 5: Searching and Sorting Algorithms

Authored by Jerry Xiao

Computers

7th - 12th Grade

Used 150+ times

C++ Quiz 5: Searching and Sorting Algorithms
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

9 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

Linear search algorithm:

Scans each index until finding a matching value

Repeatedly dividing in half the array until found

Bubble sorting technique

None of them

2.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

Linear Search works when the array is?

Sorted

Unsorted

Both

None of the above

3.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

A binary search algorithm can be best described as what?

A instant lookup method

Repeatedly dividing in half the array until found

Start at the head, move through the list until found

None of the above

4.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

When is Binary Search preferred over Linear Search?

Small Database

Sorted Database

Unsorted Database

None of the above

5.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

Using binary search in this sorted array:

3 7 10 45 84 100 153 170

How many comparisons would it take to find number 170?

0 – 1

1 – 2

3 – 4

4 – 5

6.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

The maximum comparisons needed in Binary Search on array of size 16 is:

16

8

4

5

7.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

The maximum comparisons needed in Linear Search on array of size 32 is:

32

33

16

31

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?