4_Arrays — Linear Search

Quiz
•
Computers
•
10th - 11th Grade
•
Hard
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
Similar Resources on Wayground
10 questions
Arrays

Quiz
•
10th - 12th Grade
10 questions
Quiz 16 - Arrays and Loops

Quiz
•
11th Grade
10 questions
AP CS A Unit 6 Quiz PRACTICE

Quiz
•
9th - 12th Grade
10 questions
Programming

Quiz
•
1st - 10th Grade
10 questions
Arrays

Quiz
•
11th Grade
10 questions
ArrayLists

Quiz
•
11th - 12th Grade
10 questions
MS Excel VLookup

Quiz
•
9th - 12th Grade
10 questions
Chapter 05 Worksheet

Quiz
•
10th Grade
Popular Resources on Wayground
50 questions
Trivia 7/25

Quiz
•
12th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
11 questions
Negative Exponents

Quiz
•
7th - 8th Grade
12 questions
Exponent Expressions

Quiz
•
6th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
20 questions
One Step Equations All Operations

Quiz
•
6th - 7th Grade
18 questions
"A Quilt of a Country"

Quiz
•
9th Grade