Data Structure

aali's Avatar, Join Date: Jul 2008
Go4Expert Member
Hi

guys
I want to ask how can i dublicate a stack
if the stack is array or linked list?
0
binodbdrchand's Avatar, Join Date: Aug 2007
Newbie Member
what do you mean duplicate? do you mean make a copy?
0
aali's Avatar, Join Date: Jul 2008
Go4Expert Member
No
I mean

to let the stack=2*stack
void dublicatestack(stack m2)
{
int m;
while(!isEmpty())
{
m=pop();
m2.push(m);
push(m2.pop());
push(m);
.
.
.
.

}