Implemented traversal of an array.