Explore BrainMass

Computing Running Time of a Pseudo Code

Alg. : MIN (a[1],..., a[1])
m <--- a[1];
for I <--- 2 to n
if a[1] < m
then m <---a[1];

Compute T(n), the running time for this algorithm.

Solution Preview

The loop goes through the input exactly once. If there are n items in the input then the ...

Solution Summary

An example showing computation of run-time of an pseudo code.