Answer the question
In order to leave comments, you need to log in
How does this array work?
People help to deal with the array. I understand what the result will be in the end, but I do not understand how it works.
For example, in line 14: array[array.length - i - 1] - Why do we get 8 here? What does i equal here? -1 - are we discarding the last cell?
Answer the question
In order to leave comments, you need to log in
It is obvious that in [14] line at the zero place of the array array we put an element from the zero line and the 7th column, and this element is equal to 8.
means that there are 8 elements in the array, but because the array starts from a zero element, then according to the rules, the number of the last cell is 1 less, i.e. 7, so .
is explained by the fact that we gradually go through all the cells in order, starting with the last one.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question