Programmers incorporate iteration and selection into code as a way of providing instructions for the computer to process each of the many possible input values.
For algorithms in the context of a particular specification that requires the use of array traversals:
§ Identify standard algorithms.
§ Modify standard algorithms.
§ Develop an algorithm.
There are standard algorithms that utilize array traversals to:
Determine a minimum or maximum value
Compute a sum, average, or mode
Determine if at least one element has a particular property
Determine if all elements have a particular property
Access all consecutive pairs of elements
There are standard array algorithms that utilize traversals to:
Shift or rotate elements left or right § Reverse the order of the elements
Determine the presence or absence of duplicate elements
Determine the number of elements meeting specific criteria