Back to Browse

GRE Computer Science Question 46

2.9K views
Apr 4, 2012
2:54

46. Consider the following pseudocode fragment. i = 0; j = 0; k = 0; while (i less-than 10 and j less-than 10) { if (A[i] greater-than B[j]) { C[k] = A[i]; k = k + 1 ; i = i + 1 ; } else { C[k] = B[j]; k = k + 1 ; j = j + 1 ; } } Which of the following could serve as a loop invariant for the while loop above? I. i less-than 10 or j less-than 10 II. i less-than 11 and j less-than 11 III. k = i + j (A) I only (B) I and II only (C) I and III only (D) II and III only (E) I, II, and III

Download

0 formats

No download links available.

GRE Computer Science Question 46 | NatokHD