MCPcopy Create free account
hub / github.com/PrajaktaSathe/Java / printOutput

Method printOutput

Programs/RotateLinkedList.java:66–76  ·  view source on GitHub ↗
(SinglyLinkedNode newHead)

Source from the content-addressed store, hash-verified

64 }
65
66 private static void printOutput(SinglyLinkedNode newHead) {
67 System.out.print("[");
68 do {
69 System.out.print(newHead.val);
70 newHead = newHead.next;
71 if (newHead != null) {
72 System.out.print(",");
73 }
74 } while(newHead != null);
75 System.out.println("]");
76 }
77
78 /**
79 * Given the head of a linked list, rotate the list to the right by k places.

Callers 1

mainMethod · 0.95

Calls 1

printMethod · 0.80

Tested by

no test coverage detected