Mark 0.00 out of 1.00
Suppose that n² > 1. Then n > 1.
Flag question
(II) If n is a real number with n > 3, then n² > 9.Suppose that n² ≤ 9. Then n ≤ 3.
a. Both are not valid.
b. Both are valid.
c. (I) is not valid, (II) is valid.
d. (I) is valid, (II) is not valid.
The correct answer is:
(I) is not valid, (II) is valid.
Question 50
Let's consider the following algorithm:
Complete
procedure linear search(x: integer, a1, a2,..., an: distinct integers)
Mark 1.00 out of 1,00
location := 0
1:= 1
Flag question
while (i≤ n and x ≠ a₁):
/:/+1
if is n then location := /
return location{location is the subscript of the term that equals x, or is 0 if x is not found)
We use this algorithm to search for x=3 in the list [1, 4, 5, 3, 6, 8, 7, 2]. What is the value of location after the third while's loop executed?
A. 2
B. 4