teach-ict.com logo

THE education site for computer science and ICT

Array traversal

Most computer languages support the concept of array - a collection of related data items held in a single data structure.

In addition, the computer language may also support an efficient way to access each element of the array in turn in order to do some data processing or comparison. This is called array traversal.

A typical array traversal command is FOR EACH x in array

This means that each element in the array will be accessed and the commands within the for each loop will be carried out on that element.