Search Header Logo

4_Arrays — Linear Search

Authored by Pratima SEEWOONAUTH

Computers

10th - 11th Grade

Used 62+ times

4_Arrays — Linear Search
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

5 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following statements is true about searching an array?

Linear search is the only method used to search an array.

The built-in search() function can be used to search an array.

The built-in find() function can be used to search an array.

There are no specific built-in functions to search for an array.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which loop is used to move through the array elements in a linear search?

"for" loop

"while" loop

"repeat until" loop

"do" loop

3.

FILL IN THE BLANK QUESTION

30 sec • 1 pt

To search an element in a given array, linear search will proceed step by step in a ____________ order, starting from the first element in the given array.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In every search iteration, the target value is compared with the current value of the array by using the following operator:

=

==

<>

>=

5.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What is the output of the following piece of code (assume that the code is indented properly):

num = arr.array('i', [1, 3, 5, 7, 9])

for i in range(len(num)):

if num[i] == 5:

print(i)

2

3

5

returns an error

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?