A Level CS Binary Search

A Level CS Binary Search

12th Grade

10 Qs

quiz-placeholder

Similar activities

Binary conversion

Binary conversion

7th - 12th Grade

10 Qs

Mobile CSP Unit 5 Vocab

Mobile CSP Unit 5 Vocab

10th - 12th Grade

15 Qs

CSF U2 Algorithms p1

CSF U2 Algorithms p1

9th - 12th Grade

10 Qs

human computer interaction

human computer interaction

12th Grade

16 Qs

Neural Networks 10-16

Neural Networks 10-16

8th Grade - University

10 Qs

42. Algorithm - Binary Search Quiz

42. Algorithm - Binary Search Quiz

9th - 12th Grade

11 Qs

Sorting & Searching Algorithms

Sorting & Searching Algorithms

12th Grade

16 Qs

SLR5 | Algorithms

SLR5 | Algorithms

12th Grade

15 Qs

A Level CS Binary Search

A Level CS Binary Search

Assessment

Passage

Computers

12th Grade

Easy

Created by

M Hirani

Used 2+ times

FREE Resource

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

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?