510,374 views
42 votes
42 votes
Natalie is writing an algorithm for searching a number from an array. If the number does not match with any of the elements in the array, what value will the program ideally return?

A. 0
B. 1
C. -1
D. 2

User Cevdet
by
2.9k points

1 Answer

21 votes
21 votes

Answer:

C. -1

Step-by-step explanation:

Failed sequential search always gives -1

User Saga
by
2.8k points