wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

G10 CS Linear Search

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

In which of the following cases, linear search algorithm is used?

a)

To search an element in ORDERED list

b)

To search an element in a list of few elements.

c)

Well suited for almost type of list

d)

To search in an unordered list consisting of few elements

e)

None of the choices

2.

What is the worst case scenario of search array students?

a)

(a) All searches take the same time

b)

(b) Item = Henry

c)

(c) Item = Annabelle

d)

(d) B or C

e)

(e) None

3.

What is the best case scenario of search array students?

a)

(a) item = Andrew

b)

(b) Item = George

c)

(c) Item = Annabelle

d)

(d) All searched take the same time

e)

(e) None

4.

A linear search takes 2 inputs: one is a ordered list and another one is unsorted list. Which of the two will be sorted faster?

a)

Sorted List

b)

Unsorted List

c)

Depends on the item of the position in the list

d)

Not applicable

5.

Under which of the following conditions is a linear search complete?

a)

(a) Item is found

b)

(b) Item is not present in the list

c)

(c) a or b

d)

None

6.

How many times is the code inside while loop (position = position + 1) executed if item = ‘G’?

a)

1

b)

2

c)

3

d)

4

e)

8

7.

How many times is the code inside while loop (position = position + 1) executed if item = ‘K’?

a)

5

b)

6

c)

7

d)

4

e)

8

8.

What is the output if item = 'R'

a)

item found at position 4

b)

item not found

c)

item found at position 3

d)

item found at position 5

e)

None

9.

What is the output if item = 'H'

a)

item found at position 4

b)

item not found

c)

item found at position 3

d)

item found at position 5

e)

Item found in another list

10.

Which of the following is true about Linear Search algorithm?

a)

Linear Search algorithm checks each element one by one

b)

The worst case scenario of a linear search occurs if the item is not in the list

c)

The worst case scenario of a linear search occurs if the item is the last element in the list

d)

All of the above.