コード例 #1
0
ファイル: Program.cs プロジェクト: seth-hayward/150questions
 public void push(int d)
 {
     Node t = new Node(d);
     t.next = top;
     top = t;
 }
コード例 #2
0
ファイル: Program.cs プロジェクト: seth-hayward/150questions
 public int? pop()
 {
     if (top != null)
     {
         Node item = top;
         top = top.next;
         return item.data;
     }
     return null;
 }