Search Header Logo

A Level CS Binary Search

Authored by M Hirani

Computers

12th Grade

Used 2+ times

A Level CS Binary Search
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 the first step in implementing a binary search algorithm?

Initializing variables with their starting states

Sorting the dataset

Calculating the midpoint of the dataset

Entering a while loop

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What must be true for a binary search to be performed?

The data set must contain string values only

The data set must be unsorted

The data set must be divided into three parts

The data set must be sorted

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the binary search algorithm do after each iteration if the item is not found?

It repeats the search on the entire dataset

It stops the search

It discards half of the dataset

It adds more data to the dataset

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which variable is used to indicate whether the item has been found in a binary search?

first

last

midpoint

found

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How is the midpoint calculated in a binary search algorithm?

By dividing the dataset into equal parts

By subtracting the last index from the first

By adding the first and last index and dividing by two

By multiplying the first and last index

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What happens if the item at the midpoint is less than the item being searched for?

The search stops

The first variable is adjusted to midpoint plus one

The last variable is adjusted to midpoint plus one

The first variable is adjusted to midpoint minus one

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the condition for the while loop to continue executing in a binary search?

found equals true

first is greater than last

The dataset is fully searched

first is less than or equal to last and found equals false

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?