What is binary search used for?
2.3.1(f) Binary Search

Passage
•
Computers
•
12th Grade
•
Easy
RHSC Computing
Used 1+ times
FREE Resource
7 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Calculating the sum of all elements in an array
Finding a target value in an unsorted array
Sorting an array in ascending order
Finding a target value in a sorted array
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How does binary search reduce the search area?
By eliminating one value at a time
By eliminating one third of the remaining values
By randomly selecting a new search area
By eliminating half of the remaining values
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the initial step in a binary search algorithm?
Selecting the leftmost value of the array
Selecting the rightmost value of the array
Sorting the array
Finding the middle value of the array
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What happens if the value at mid is greater than the target?
The search continues with values less than mid
The search continues with values greater than mid
The algorithm restarts from the beginning
The algorithm returns the mid index
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the time complexity of binary search?
O(n)
O(n log n)
O(log n)
O(1)
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the binary search algorithm return if the target is not found?
-1
The index of the closest value
The last index searched
0
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How is the 'mid' index calculated in binary search?
By averaging the left and right indices and rounding up
By averaging the left and right indices and rounding down
By selecting the leftmost index
By selecting the rightmost index
Similar Resources on Quizizz
10 questions
G10 CS Binary Search

Quiz
•
12th Grade
10 questions
Website Design

Quiz
•
KG - University
11 questions
1.4.(c) Data Structures (video)

Quiz
•
12th Grade
13 questions
Arrays in Swift

Quiz
•
10th - 12th Grade
10 questions
H446 Paper 2 Prep

Quiz
•
12th Grade
9 questions
"Searching " in Python

Quiz
•
12th Grade
10 questions
Arrays

Quiz
•
10th - 12th Grade
13 questions
A-level linked lists (video)

Quiz
•
12th Grade
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade
Discover more resources for Computers
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
20 questions
Taxes

Quiz
•
9th - 12th Grade
17 questions
Parts of Speech

Quiz
•
7th - 12th Grade
20 questions
Chapter 3 - Making a Good Impression

Quiz
•
9th - 12th Grade
20 questions
Inequalities Graphing

Quiz
•
9th - 12th Grade
10 questions
Identifying equations

Quiz
•
KG - University