consider following recursive code:
algorithm xyz(t,S)
{
k=S.size();
while(!S.isempty())
{ S.pop();
t++;
//S:a new stack of size k-1
xyz(t,S);
}
}
starting with the call xyz(0,S),where S is a stack of n element(1,2,3,4......),
[ doubt is after first fun call xyz(0,S) when we cheak while loop,after t++ should execute once again xyz function or cheak while loop??]
how this code will work?? detail explaination??