Calculating run times of programs with asymptotic notation

3.1k Views Asked by At

When calculating the run time of programs using asymptotic notation, I know how to set up the sums for things like for loops, but I'm getting stuck on summing them up.

Sorry if this is a dumb question but say we have something like

for i=4 to n^2
   for j = 5 to 3i log (i)
      s = s + ij

I would set this up with outer loop = sum from i=4 to n^2, inner loop sum from j = 5 to 3i log i, and finally a constant. I'm getting hung up on how to sum everything up. Can someone please explain this to me?