# What is the name of visiting an array starting at first element, then last element, then second, then last but one, then third, etc

For example if I have an array

[0, 1, 2, 3, 4, ..., n]


and I want to iterate over it in an order like

[0, n, 1, n - 1, 2, n - 2, ..., n // 2]


how it can be called? Is there a general name for this?

• I don't know of a name for it, but that access pattern reminds me of a deque. I'd probably just call it "alternating-ends" iteration if it doesn't have a more official name. – tjhighley Nov 22 '19 at 2:49
• I don't think iterate orders usually have any "general name". Even the basic counting may be called "incrementing", increasing order" ... But to propose one name, I would say "converging edges". – Optidad Nov 22 '19 at 13:45
• @Vince: I've hoped that for some FP-guys have an operator which iterates just like described and I can reuse its name, but it looks like it's not so common operation afterall – Azat Ibrakov Nov 22 '19 at 14:16