Binary search

Quiz
•
Other
•
11th Grade
•
Hard
Yrysjan Shakhimova
Used 380+ times
FREE Resource
9 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
In which of the following cases, binary search algorithm is used?
To search an element in an unordered list.
To search an element in a list of few elements.
To search an element in any ordered list with large number of elements.
2.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
How does a binary search algorithm works?
Dividing the list into halves until the item is matched with one in the list.
Starts with the first element and checks the next element consecutively until a match is found.
None of the above
3.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
An array with 32 elements is input to a binary search algorithm. How many maximum number of comparisons are performed?
32
16
8
5
4.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
An array with 32 elements is input to a linear search algorithm. How many maximum number of comparisons are performed?
32
16
8
5
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How is the midpoint of the list calculated?
midpoint= round ((first_element+last_element)/2)
midpoint=(lower_bound+upper_bound)/2
midpoint= round ((lower_bound+upper_bound)/2)
midpoint= round ((lower_bound+upper_bound))
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Under which of the following conditions, binary search algorithm terminates?
Item_found=true
lower_bound <= upper_bound
lower_bound > upper_bound
A or C
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Complete the sentence: The lower half of the list is discarded if the value at midpoint is …………………….. item searched.
less than
greater than
equal to
8.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
True or False: The upper half of the list is discarded if the value at midpoint is greater than item searched.
True
False
9.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
What is the disadvantage of binary search algorithm?
It takes longer time when compared to linear search algorithm
It works only on sorted lists
It is very complex to understand
Similar Resources on Wayground
10 questions
Traveling Salesperson Problem

Quiz
•
10th - 12th Grade
10 questions
Introduction to Setting Financial Goals Quiz

Quiz
•
9th - 12th Grade
12 questions
Searching for information

Quiz
•
9th - 11th Grade
6 questions
AI and Data Science Quiz 1

Quiz
•
8th - 12th Grade
12 questions
Physiological Problems and Beneficial Insects

Quiz
•
9th - 12th Grade
13 questions
The Great Portsmouth Digital Quiz of the Year - Secondary

Quiz
•
9th Grade - University
11 questions
Cyber Camp 2

Quiz
•
11th Grade
10 questions
Review: Conducting Research Online

Quiz
•
9th - 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
Discover more resources for Other
10 questions
Video Games

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

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

Lesson
•
11th Grade
28 questions
Ser vs estar

Quiz
•
9th - 12th Grade
13 questions
BizInnovator Startup - Experience and Overview

Quiz
•
9th - 12th Grade
16 questions
AP Biology: Unit 1 Review (CED)

Quiz
•
9th - 12th Grade
7 questions
SAT Reading & Writing Practice Test - Reading Focus

Quiz
•
11th Grade
20 questions
Parallel lines and transversals

Quiz
•
9th - 12th Grade