the proposed solution will work for only binary tree. The question does not clarify about it.
@Nir, what is a recursion you are referencing? You just traverse the tree in a way you like while keeping track to the "order number" of the element and place it to preallocated array.