Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   Data Structure (http://www.go4expert.com/forums/data-structure-t12266/)

aali 20Jul2008 13:48

Data Structure
 
Hi

guys
I want to ask how can i dublicate a stack
if the stack is array or linked list?

binodbdrchand 21Jul2008 11:16

Re: Data Structure
 
what do you mean duplicate? do you mean make a copy?

aali 21Jul2008 14:23

Re: Data Structure
 
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);
.
.
.
.

}


All times are GMT +5.5. The time now is 10:27.