loops and iteration the standard approach in most programming languages for repeating process certain number of timessuch as moving sequentially through an array to perform the same operations on each iteminvolves loop in pseudocodethis would typically take the general form for ,ndo something and in programming languages like and java this would be written as the for-loop fori +/do something in which counter keep tracks of doing "the somethingn times for examplewe could compute the sum of all items in an array using fori sum +sum + [ ]we say that there is iteration over the index the general for-loop structure is forinitialization condition update repeated process in which any of the four parts are optional one way to write this out explicitly is initialization if not condition go to loop finished loop start repeated process update if condition go to loop start loop finished in these noteswe will regularly make use of this basic loop structure when operating on data stored in arraysbut it is important to remember that different programming languages use different syntaxand there are numerous variations that check the condition to terminate the repetition at different points invariants an invariantas the name suggestsis condition that does not change during execution of given program or algorithm it may be simple inequalitysuch as " "or something more abstractsuch as "the items in the array are sortedinvariants are important for data structures and algorithms because they enable correctness proofs and verification in particulara loop-invariant is condition that is true at the beginning and end of every iteration of the given loop consider the standard simple example of procedure that finds the minimum of numbers stored in an array