示例#1
0
        IEnumerator <SecondList> IEnumerable <SecondList> .GetEnumerator()
        {
            SecondNode <SecondList> current = head;

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

                current = current.Next;
            }
        }
示例#2
0
        public void Add(SecondList data)
        {
            var node = new SecondNode <SecondList>(data);

            if (head == null)
            {
                head = node;
            }
            else
            {
                tail.Next     = node;
                node.Previous = tail;
            }
            tail = node;
            count++;
        }
示例#3
0
        public void AddFirst(SecondList data)
        {
            var node = new SecondNode <SecondList>(data);
            SecondNode <SecondList> temp = head;

            node.Next = temp;
            head      = node;
            if (count == 0)
            {
                tail = head;
            }
            else
            {
                temp.Previous = node;
            }
            count++;
        }
示例#4
0
 public void Clear()
 {
     head  = null;
     tail  = null;
     count = 0;
 }