The below question is based on following program:
procedure mystery (A : array [1..100] of int)
int i,j,position,tmp;
begin
for j := 1 to 100 do
position := j;
for i := j to 100 do
if (A[i] > A[position]) then
position := i;
endfor
tmp := A[j];
A[j] := A[position];
A[position] := tmp;
endfor
end
The number of times the test $A[i] > A[\text{position}]$ is executed is:
- $100$
- $5050$
- $10000$
- Depends on contents of $A$