traverses the permutation list
while (q != NULL)
{
printf("\n%d\n",q->info);
q = q->link;
}