Exemplo n.º 1
1
        public void ShallowCopy(LinkedStack sourceStack)
        {
            StackNode currNode;

              this.Clear();
              for (currNode=sourceStack.top.Next; currNode!=null; currNode=currNode.Next)
            this.Push(currNode.Data);
        }
Exemplo n.º 2
-1
        public void DeepCopy(LinkedStack sourceStack)
        {
            StackNode currNode;

              this.Clear();
              for (currNode=sourceStack.top.Next; currNode!=null; currNode=currNode.Next)
            this.Push(((ICloneable)currNode.Data).Clone());
        }