Consider the following code fragment: int[] x1 = {1, 2, 4, 7};
int[] x2 = {1, 2, 5, 7};
int i1 = x1.length-1; int i2 = x2.length-1; int count = 0; while ((i1>0) && (i2>0)){
if (x1[i1] == x2[i2]) {
+c -il;
-i2;
}
else {
if (x1[i1] < x2[i2])
-i2; else
-il;
}
}
After the above while loop finishes, 'count' contains what value?

a) 3 b) 2 c) 1 d) 0 Figure 1: Java Version of Leeds Question 2 taken from [34]

## An Illustrating Example 2

In order to illustrate some of the questions around exercise complexity, we present an example taken from [34] as shown in Figure 1. The example is referred to as the Java version of Question 2. It was used in the "Leeds"-Group study as explained by the authors in the context of testing program reading and understanding capabilities. Some studies in the past have revealed weaknesses in programmers on relation with these basic skills ([35]).

The example constitutes a nice case of reasoning about exercise complexity in the way we are interested to formalize.

According to the cited work the steps indicated in Figure 2 represent a reasonable solution plan that can be expected to be followed by some responder. The answer a) is the result of following this plan.