Counting Nested Loops

Counting Nested Loops

For i := 1 to n do

For j := 1 to n do

a := a + 1

End For

End For

Total Operations = n2

For i := 1 to n do

For j := 1 to 3 do

a := a + 1

End For

End For

Total Operations = 3n

Previous slide Next slide Back to the first slide View Graphic Version