예제 #1
0
        public DailyListElement Add()
        {
            var newItem = new DailyListElement();

            if (head != null)
            {
                head.next = newItem;
            }
            head = newItem;
            return(newItem);
        }
        public DailyListElement Add()
        {
            var dailyListElement = new DailyListElement();

            if (head != null)
            {
                head.next = dailyListElement;
            }
            head = dailyListElement;
            return(dailyListElement);
        }
예제 #3
0
        public IEnumerable <DailyListElement> GetAllNodes()
        {
            DailyListElement        current = head;
            List <DailyListElement> lst     = new List <DailyListElement>();

            while (current != null)
            {
                lst.Add(current);
                current = current.next;
            }
            return(lst);
        }
예제 #4
0
 public void Add(DailyListElement newItem)
 {
     if (current != null)
     {
         current.next = newItem;
     }
     current = newItem;
     if (head == null)
     {
         head = current;
     }
 }