I'm reading "Data structures and algorithms" from Aho, Hopcroft & Ullman, and I'm confused with exercise 1.12 B:
Which is the computational complexity (expressed in Big O notation) of this Pascal procedure?
procedure mysterious( n: integer );
var
i, j, k: integer;
begin
for i := 1 to n - 1 do
for j := i + 1 to n do
for k := 1 to j do
{mysterious statement of O(1)}
end
Could you please help me?
Thanks!