CSC300 / CSC402: Rules for looping [13/14] Previous pageContentsNext page

There is an index (more generally, some metric)

    i

Start somewhere valid

    i = 0

Base case says when to stop

    i >= a.length

Inductive case takes us closer to base case

    i = i + 1

Previous pageContentsNext page