示例#1
0
        public StckInternal <T> Reverse()
        {
            var s = new StckInternal <T>();

            foreach (var item in this)
            {
                s = s.Push(item);
            }
            return(s);
        }
示例#2
0
 /// <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();
 }
示例#3
0
 /// <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();
 }