4_Arrays — Linear Search

4_Arrays — Linear Search

10th - 11th Grade

5 Qs

quiz-placeholder

Similar activities

Traversing Arrays

Traversing Arrays

10th - 12th Grade

6 Qs

CodeHS 5.7 2D Arrays

CodeHS 5.7 2D Arrays

9th - 12th Grade

10 Qs

AP CSA 2D Array

AP CSA 2D Array

10th - 12th Grade

6 Qs

Algoritma dan Pemrograman Quiz

Algoritma dan Pemrograman Quiz

10th Grade

10 Qs

One Dimensional Array

One Dimensional Array

11th Grade

10 Qs

Nat 5 Standard Algorithms + Predefined Functions

Nat 5 Standard Algorithms + Predefined Functions

8th - 10th Grade

10 Qs

2.1.3 CSE Arrays

2.1.3 CSE Arrays

9th - 12th Grade

9 Qs

Linear and Binary Search Algorithms

Linear and Binary Search Algorithms

11th Grade

10 Qs

4_Arrays — Linear Search

4_Arrays — Linear Search

Assessment

Quiz

Computers

10th - 11th Grade

Hard

Created by

Pratima SEEWOONAUTH

Used 62+ times

FREE Resource

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