1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Data Structure

Discussion in 'C' started by aali, Jul 20, 2008.

  1. aali

    aali New Member

    Joined:
    Jul 16, 2008
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    student
    Location:
    Riyadh
    Hi

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

    binodbdrchand New Member

    Joined:
    Aug 21, 2007
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    0
    what do you mean duplicate? do you mean make a copy?
     
  3. aali

    aali New Member

    Joined:
    Jul 16, 2008
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    student
    Location:
    Riyadh
    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);
    .
    .
    .
    .

    }
     

Share This Page