Hi there,

This is for an assignment, but I'm having trouble with some basic examples.

I need to calculate the actual number of basic operations from the following algorithm and the big-o complexity:

Code:

for i = 1..n
for j = 1..i
for k = 1..i
x[j][i]++;

A pretty simple little algorithm.

My basic idea is to set up a summation like this:

$\displaystyle \sum_{i=1}^{n} \sum_{j=1}^{i} \sum_{k=1}^{i} 1$

I guess first up, does this summation look correct, or am I waaay off. (I'm taking an algorithm course, but my discrete math is very fuzzy).

(I'll have follow ups on how to properly execute the summation, because I'm having some trouble with that as well. But no use continuing that if my summation is wrong to begin with.)

thanks.