title: Is recursion or stack necessary for factorial time complexity algorithms?
body: <p>I have a set with elements. I need to generate all the permutations of those elements.</p>
  
  <p>The time complexity of the algorithm that I'm using is O(n!) and it is recursion based. Naturally every recursive algorithm can be converted to non-recursive using an infinite loop and a stack.</p>
  
  <p>Is it possible to generate all the permutations without using either recursion or the stack + loop equivalence ?</p>