Search Header Logo

Searching and sorting algorithms

Authored by Anthony Moran

Computers

10th Grade

Used 1+ times

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

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a necessary condition for using binary search instead of linear search?

The list must be sorted.
The list must contain unique elements.
The list must be small in size.
The list must be unsorted.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

If a binary search takes 3 steps to find an item in a sorted list of 8 elements, how many steps will it take for a list with 16 elements in the worst case?

5 steps
4 steps
3 steps
2 steps

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In which scenario is linear search more efficient than binary search?

When searching for multiple occurrences of an item.
When the list is unsorted.
When the list is very large.
When the list is sorted.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Given the list [5, 2, 9, 3, 7], how many comparisons would linear search make to find the value 7?

5 comparisons
4 comparisons
2 comparisons
3 comparisons

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What occurs during a single pass of the bubble sort algorithm?

The largest element is moved to its correct position.
The elements are sorted in descending order.
The list is divided into sub-lists.
The smallest element is moved to its correct position.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How many passes would bubble sort require in the worst case to fully sort a list of 5 elements?

5 passes
2 passes
4 passes
3 passes

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In the worst case, how many total comparisons would bubble sort make for a list of 6 elements?

28 comparisons
21 comparisons
36 comparisons
15 comparisons

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?