asdf
public text v1 · immutablefor (i = 1 through n) {
for (j = 1 through i) {
for (k = 1 through 5)
task t
}
}
innermost: 5*t
j loop: 5*t*i
outermost: 5*t*n*(n+1)/2
Why is (n+1)/2?for (i = 1 through n) {
for (j = 1 through i) {
for (k = 1 through 5)
task t
}
}
innermost: 5*t
j loop: 5*t*i
outermost: 5*t*n*(n+1)/2
Why is (n+1)/2?