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; } }
public void Pop() { top = top.Next; }