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