Exemplo n.º 1
0
Arquivo: Stack.cs Projeto: Raumo0/Labs
 public void Push(string value)
 {
     var item = new StackItem(value);
     item.Next = _head;
     _head = item;
     Count++;
 }
Exemplo n.º 2
0
Arquivo: Stack.cs Projeto: Raumo0/Labs
 public string Pop()
 {
     if (_head == null)
         return null;
     var result = _head.Value;
     _head = _head.Next;
     Count--;
     return result;
 }
Exemplo n.º 3
0
Arquivo: Stack.cs Projeto: Raumo0/Labs
 public Stack()
 {
     _head = null;
     Count = 0;
 }