/// <summary> /// Makes all next variables equal to null /// </summary> private void FlushNext() { if (next != null) { next.FlushNext(); next = null; } }
/// <summary> /// Adds a new item to the MyListStack /// </summary> /// <param name="index"></param> /// <param name="value">The value that needs to be added</param> public void Add(int index, double?value) { // stop condition if (item == null) { item = value; } else if (next == null) { next = new MyListStack <T>(); next.item = item; item = null; Add(0, value); } else { next.Add(0, item); item = value; } }
/// <summary> /// The constructor of the class Calculator logic /// </summary> public CalculatorLogic() { myListStack = new MyListStack <double>(); listStack = new ListStack(); arrayStack = new ArrayStack(); }