Preorder traversal of a tree
It depends. (As usual.)

The recursive version is easier to read an maintain, and does the job fine for relatively small data sets.

However, when the data set grows large, you create a new stack frame for each recursive call, which may lead to great stack memory usage up to stack overflow. Furthermore, this is comparatively slow.

The second version uses constant stack size and puts all the real memory usage in the heap where it should be. Not using recursion, it is also bound to be faster (on a micro-level only).

Thus, know the problem you solve: for small sets, write nice code and use your version, for big data sets, optimize by unrolling and use the second version.

(BTW: in my university courses, it was generally recommended to use the second version for NP problems due to raw speed - albeit in C at that time.)