A recursive algorithm is simply an algorithm that uses a stack.
The recursion allows you to use the call stack as your data stack.
Any recursive function taking this form:
void perm(char*a, const int k, const int n)
{
// check if your code should return
// make a recursive call with new data
}
Can be changed to this:
void perm(char*a, const int k, const int n)
{
// Create a stack, push (a,k,n)
while ( /* stack isn't empty */ )
{
// check if stack should be *popped* (instead of returning)
// Put new data on the stack (instead of recursing)
}
}