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