public float Pop() { if (head != null) { float tmp = head.Element; amountOfElements--; head = head.Next; return tmp; } else { throw new EmptyStackException("Empty Stack"); ; } }
public StackElement(StackElement next, float value) { this.Next = next; this.Element = value; }
public void Push(float value) { StackElement tmp = new StackElement(head, value); head = tmp; amountOfElements++; }