コード例 #1
0
        public void InsertBack(object data)
        {
            DoubleNode temp = new DoubleNode();

            temp.SetData(data);

            if (back == null)
            {
                front = back = temp;
            }
            else
            {
                temp.SetPrevious(back);
                back.SetNext(temp);
                back = temp;
            }
            size++;
        }
コード例 #2
0
        public void InsertFront(object data)
        {
            DoubleNode temp = new DoubleNode();

            temp.SetData(data);

            if (front == null)
            {
                back = front = temp;
            }
            else
            {
                temp.SetNext(front);
                front.SetPrevious(temp);
                front = temp;
            }
            size++;
        }