public Object next()
            {
                LinkedNode <T> toReturn = currentEl;

                if (currentEl.Prev != null)
                {
                    currentEl = currentEl.Prev;
                }
                counter++;
                return(toReturn.Value);
            }
예제 #2
0
        public void Add(T value)
        {
            LinkedNode <T> newNode = new LinkedNode <T>(value);

            if (head == null)
            {
                head = newNode;
                tail = head;
            }
            else
            {
                tail.Next    = newNode;
                newNode.Prev = tail;
                tail         = newNode;
            }
            length++;
        }
 public CustomLinkedListIterator(CustomLinkedList <T> arg)
 {
     myList    = arg;
     currentEl = myList.tail;
     counter   = 0;
 }