Пример #1
0
 public void Push(int x)
 {
     if (top == null)
     {
         top = new Node(x);
         top.Min = x;
     }
     else
     {
         Node temp = new Node(x);
         temp.Min = x < top.Min ? x : top.Min;
         temp.Next = top;
         top = temp;
     }
 }
Пример #2
0
 public void Pop()
 {
     top = top.Next;
 }