Arrays Records and Pointers
Arrays Records and Pointers
Dr. Vijay Kumar Samyal, Assistant Professor, Dept of CSE, MIMIT, Malout 4
Algorithm 4.1(Traversing a Linear
Array)
• Here LA is a linear array with lower bound LB and
upper bond UB. This algorithm traverses LA
applying an operation PROCESS to each element
of LA.
• 1. [Initialize counter] Set K := LB
• 2. Repeat steps 3 and 4 while K ≤ UB
• 3. [Visit element] Apply PROCESS to LA[K]
• 4. [Increase counter] Set K := K + 1
• 5. [End of Step 2 loop]