Skip to content

Arrays: Access

Task: Read the element at index 3

012341020304050READ OUT401050

What you are watching

Reaching a[3] does not involve the four values around it. The position is worked out from the index rather than searched for, so the read goes straight to that one slot and costs the same as reaching a[0] or a[4]. Nothing in the row is moved or looked at on the way, which is the difference between accessing an array and traversing it.