示例#1
0
 public void initList()
 {
     head.setprev(null);
     head.setnext(tail);
     tail.setnext(null);
     tail.setprev(head);
 }
示例#2
0
        public void AddLast(T element)
        {
            Node <T> cursor  = tail;
            Node <T> newNode = new Node <T>(element);

            newNode.setnext(cursor);
            newNode.setprev(cursor.getprev());
            cursor.setprev(newNode);
            cursor.getprev().setnext(newNode);
            length++;
        }