Ejemplo n.º 1
0
        public T removeLast()
        {
            ListStruct <T> tmp = lastE;

            if (lastE != null)
            {
                if ((lastE = firstE.getPrevStruct()) == firstE)
                {
                    firstE = lastE;
                }
                length--;
                return(tmp.getElem());
            }
            return(default(T));
        }
Ejemplo n.º 2
0
 public T this[int index]
 {
     get
     {
         ListStruct <T> tmp = firstE;
         for (int i = 0; i < index; i++)
         {
             if (tmp != null)
             {
                 tmp = tmp.getNextStruct();
             }
             else
             {
                 return(default(T));
             }
         }
         return(tmp.getElem());
     }
 }