in reply to Re: permutation algorithm
in thread permutation algorithm

Mmmm, I was trying to solve the problem without a recursion.

You are right. I am building the tree, instead of traversing it. We'd better use a recursion for this.