can someone help me to answer this question:
Express the tightest upper bound of the following loops in big-O notation.
a.
int sum = 0;
for (int j = 0; j < n; j++)
for (int k = 0; k < n; k++)
sum += j * k;
b.
for (int j = 0; j < n; j++)
for (int k = 0; k < n; k++)
for (int l = 0; l < n; l++)
sum += j * k * l;
I just learned about big-O but I don't really know how to solve this. Can anyone please help me so I would understand more. Thanks
2007-01-19
10:30:52
·
2 answers
·
asked by
?
1
in
Computers & Internet
➔ Programming & Design