We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 08c9fc8 commit 34aef89Copy full SHA for 34aef89
lectures/18-linkedlist/code/src/com/kunal/CLL.java
@@ -28,7 +28,9 @@ public void display() {
28
if (head != null) {
29
do {
30
System.out.print(node.val + " -> ");
31
- node = node.next;
+ if (node.next != null) {
32
+ node = node.next;
33
+ }
34
} while (node != head);
35
}
36
System.out.println("HEAD");
0 commit comments