示例#1
0
文件: Stack.cs 项目: kosya/university
 public float Pop()
 {
     if (head != null)
     {
         float tmp = head.Element;
         amountOfElements--;
         head = head.Next;
         return tmp;
     }
     else
     {
         throw new EmptyStackException("Empty Stack"); ;
     }
 }
示例#2
0
 public StackElement(StackElement next, float value)
 {
     this.Next = next;
     this.Element = value;
 }
示例#3
0
文件: Stack.cs 项目: kosya/university
 public void Push(float value)
 {
     StackElement tmp = new StackElement(head, value);
     head = tmp;
     amountOfElements++;
 }