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

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice