コード例 #1
0
 public T PeekTail()
 {
     if (!isEmpty())
     {
         return(tail.get_node_data());
     }
     else
     {
         throw new Exception("Cannot peek tail. Stack is empty!");
     }
 }
コード例 #2
0
 public T PeekHead()
 {
     if (!isEmpty())
     {
         return(head.get_node_data());
     }
     else
     {
         throw new Exception("Cannot peek head. Stack is empty!");
     }
 }