public StckInternal <T> Reverse() { var s = new StckInternal <T>(); foreach (var item in this) { s = s.Push(item); } return(s); }
/// <summary> /// Ctor that takes an initial state as a Lst T /// </summary> internal StckInternal(Lst <T> initial) { tail = new StckInternal <T>(); foreach (var item in initial) { value = item; tail = tail.Push(item); Count++; } tail = tail.Pop(); }
/// <summary> /// Ctor that takes an initial state as an IEnumerable T /// </summary> public StckInternal(IEnumerable <T> initial) { tail = new StckInternal <T>(); foreach (var item in initial) { value = item; tail = tail.Push(item); Count++; } tail = tail.Pop(); }