wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Search Algorithms in Python (A)

Total questions: 8

Worksheet time: 17mins

Name
Class
Date
1.

What is the purpose of a search algorithm in Python?

a)

Sorting elements in a list

b)

Locating a specific item in a collection

c)

Creating a new list from existing elements

d)

Performing mathematical calculations

2.

Binary search requires a (a)   list for optimal performance

3.

What is an advantage of the binary search algorithm over linear search?

a)

It works on unsorted lists

b)

It take lower time

c)

It is easier to implement

d)

It requires less memory

4.

Which of the following algorithms was not mentioned in the lectures?

a)

Binary Search

b)

Linear Search

c)

Fibonacci Search

d)

Jump Search

5.

In (a)   search algorithm, the list is divided into fixed-size blocks, and it loops over a fixed number of parts ahead before performing a linear search within that range.

6.

What is the main advantage of the jump search algorithm?

a)

It is faster than binary search

b)

It works on unsorted lists

c)

It requires less memory

d)

It is easier to implement

7.

Which search algorithm use this rule?

index = low + [(val-numbers[low])*(high-low) / (numbers[high]-numbers[low])]

a)
Linear Search
b)
Binary Search
c)
Depth First Search
d)
Interpolation Search
8.

Jump binary search is the best search algorithm among all others, is that right? and why?

4 lines