@@ -115,45 +115,4 @@ public E remove(int pos) {
115115 size --;
116116 return removedValue ;
117117 }
118-
119- /**
120- * A small demonstration of the above implemented circular doubly linked list
121- * here we're initializing the circular doubly linked list, chronologically
122- * adding and removing the linked list elements and demonstrating methods like
123- * getSize()
124- */
125- public static void main (String [] args ) {
126- CircularDoublyLinkedList <Integer > list = new CircularDoublyLinkedList <>();
127-
128- System .out .println ("Initial list: " + list );
129- System .out .println ("Initial size: " + list .getSize ());
130-
131- System .out .println ("Appending 10, 20, 30." );
132- list .append (10 );
133- list .append (20 );
134- list .append (30 );
135-
136- System .out .println ("List content: " + list );
137- System .out .println ("List size: " + list .getSize ());
138-
139- System .out .println ("Removing element at position 1." );
140- int removed = list .remove (1 );
141- System .out .println ("Removed element: " + removed );
142-
143- System .out .println ("List content after removal: " + list );
144- System .out .println ("List size after removal: " + list .getSize ());
145-
146- System .out .println ("Removing element at position 0." );
147- removed = list .remove (0 );
148- System .out .println ("Removed element: " + removed );
149-
150- System .out .println ("List content after second removal: " + list );
151- System .out .println ("List size after second removal: " + list .getSize ());
152-
153- System .out .println ("Appending 40." );
154- list .append (40 );
155-
156- System .out .println ("List content: " + list );
157- System .out .println ("List size: " + list .getSize ());
158- }
159118}
0 commit comments