public void ShallowCopy(LinkedStack sourceStack) { StackNode currNode; this.Clear(); for (currNode=sourceStack.top.Next; currNode!=null; currNode=currNode.Next) this.Push(currNode.Data); }
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()); }