Exemplo n.º 1
0
        public StckInternal <T> Reverse()
        {
            var s = new StckInternal <T>();

            foreach (var item in this)
            {
                s = s.Push(item);
            }
            return(s);
        }
Exemplo n.º 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();
 }
Exemplo n.º 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();
 }