121k views
4 votes
Assume that the array arr has been defined and initialized with the values {4, 2, 5, 3, 1}. What are the values in the array arr after the first pass of the while loop (i.e. when n is reduced to arr.length - 2 by the line before the point indicated by /* end of while loop */)

1 Answer

1 vote

Answer:

arr = [4, 2, 5]

Step-by-step explanation:

The while loop will remove the array elements from the back.

User Sophy Swicz
by
6.1k points