Help
Contact
For teachers and institutes
Search courses, problems, tests…
A
A
>_
StemPy Lab
Courses ▾
Problems ▾
Practice ▾
Mock Tests
Classes
Community ▾
A
A
Quizzes
/
The diagram shows the array Data with the values 14, 9, 23, 9, 31, 6, 18, 9 at the indexes 1 to 8. A linear search starts at index 1 and stops at the first 9 it finds. How many comparisons does it make?
Computer Science
Medium
High School (9–10)
Algorithms, Programming and Logic › Algorithms and Problem-Solving
IGCSE
Created by
StemPy Lab
The diagram shows the array
Data
with the values
14
,
9
,
23
,
9
,
31
,
6
,
18
,
9
14, 9, 23, 9, 31, 6, 18, 9
14
,
9
,
23
,
9
,
31
,
6
,
18
,
9
at the indexes
1
1
1
to
8
8
8
. A linear search starts at index
1
1
1
and stops at the first
9
9
9
it finds. How many comparisons does it make?
Fig. 1: An array called Data with eight boxes. From index 1 to index 8 the values are 14, 9, 23, 9, 31, 6, 18 and 9.
2
2
2
3
3
3
4
4
4
8
8
8
Check Answer
Log in to save
Tag someone
⚑ Report
← All Quizzes
← A user types a new email address twice, and the computer checks that the two are the same. What is this?
Apply exactly one pass of an ascending bubble sort to the values 6, 2, 8 and 4, kept in that order. Which arrangement results? →
More on
Algorithms, Programming and Logic › Algorithms and Problem-Solving
Discussion (0)
Log in
to join the discussion.
Loading…
All questions on this topic →
Problems on this topic
This is the kind of long scenario question that ends Paper 2…
Hard
A delivery company adds a check digit to each parcel number…
Medium
Name the check in each case. Say whether it is validation or verification…
Easy
A bubble sort is changed so that it sorts in descending order: the comparison becomes IF…
Hard
All problems on this topic →