示例#1
0
        public IEnumerator <T> GetEnumerator()
        {
            ListNodeT <T> current = Last;


            while (current != null)
            {
                yield return(current.Value);

                current = current.Prev;
            }
        }
示例#2
0
        public ListNodeT <T> AddLast(T node)
        {
            var newNode = new ListNodeT <T>(node);

            if (First == null)
            {
                First = newNode;
                Last  = First;
            }
            else
            {
                Last.Next    = newNode;
                newNode.Prev = Last;
                Last         = newNode;
            }
            return(newNode);
        }