Browse Source

add rotate to linked list test.

Charles Reid 2 years ago
parent
commit
4c1e7d9d79
1 changed files with 11 additions and 1 deletions
  1. 11
    1
      lists/linked-lists/CLinkedList.java

+ 11
- 1
lists/linked-lists/CLinkedList.java View File

@@ -75,7 +75,6 @@ public class CLinkedList<E> {
75 75
 	}
76 76
 
77 77
 
78
-
79 78
 	// Round-Robin Scheduling
80 79
 	// No head stored - because you can move forward, but not backward
81 80
 	private Node<E> tail = null;
@@ -185,8 +184,19 @@ public class CLinkedList<E> {
185 184
 			c.addLast(i);
186 185
 		}
187 186
 		System.out.println(c);
187
+
188 188
 		System.out.println("------");
189 189
 
190
+		c.rotate();
191
+		c.rotate();
192
+		c.rotate();
193
+		System.out.println(c);
194
+
195
+		System.out.println("------");
196
+
197
+		c.removeFirst();
198
+		c.removeFirst();
199
+		System.out.println(c);
190 200
 
191 201
 	}
192 202
 }