{
Save = x[i];
x [i]=x[j];
x [j]=save;
}
}
return 0;
}
Ans:
This list of operators as well as operands is given in Table.
Here N1=53 and N2=38. The program length N =N1+N2=91
Vocabulary of the program ? = ? _{1}+ ? _{2}=14+10=24
Volume V=Nxlog_{2} ?
=91x log_{2} 24=417 bits.
The estimated program length N of the program
=14 log_{2}14+10 log_{2}10
=14*3.81+10*3.32
=53.34+33.2=86.45
Conceptually unique input as well as output parameters are represented by ? *2.
? *_{2}=3 {x: array holding the integer to be sorted. This is used both as input and output}.
{N: the size of the array to be sorted}.
The potential volume V*=5 log_{2} 5=11.6
Since L=V*/V
=11.6/417=0.027
D=I/L
=1/0.027=37.03
Estimated program level
We may use another formula
Vˆ* = VxLˆ
= 417x0.038 = 15.67
The discrepancy between V* and Vˆ * doesn't inspire confidence in the application of this portion of software science theory to more complicated programs.
E=V/ Lˆ = Dˆ x V
= 417/0.038=10973.68
Consequently 10974 elementary mental discriminations are required to construct the program.