Traverse an Array


A is the collection of element of same data type.By using this algorithm of traversing we can  print or count all the element of array exactly once.

Traverse () :
This algorithm traverses a linear array  A with lower bound LB and upper bound UB and performs the operation to access each element of the  array.

Step I    :  Repeat For I = LB to UB
Step II   :       Apply Process to A[I]      [ Accessing Element ]
[ End of for loop ]
Step III :  Exit.

Leave a comment