
A Level CS Binary Search

Passage
•
Computers
•
12th Grade
•
Easy
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
Similar Resources on Wayground
15 questions
Binary Code

Quiz
•
9th - 12th Grade
12 questions
Decimal to Binary

Quiz
•
9th - 12th Grade
10 questions
1.1 Number Systems Cambridge IGCSE 0478

Quiz
•
10th Grade - University
10 questions
Number System Conversions 1

Quiz
•
9th - 12th Grade
10 questions
Telebort Program G: Data Preparation & Classification

Quiz
•
12th Grade
15 questions
Microsoft Access Practice Quiz

Quiz
•
9th - 12th Grade
10 questions
Binary to Hex

Quiz
•
9th - 12th Grade
10 questions
AP-CSP Binary Conversions

Quiz
•
7th - 12th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade