MCPcopy Create free account
hub / github.com/apna-college/Alpha / reverse

Method reverse

12_LinkedList.java/DoubleLL.java:61–75  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

59 }
60
61 public void reverse() {
62 Node curr = head;
63 Node prev = null;
64 Node next;
65
66 while(curr != null) {
67 next = curr.next;
68 curr.next = prev;
69 curr.prev = next;
70
71 prev = curr;
72 curr = next;
73 }
74 head = prev;
75 }
76
77 public static void main(String args[]) {
78 DoubleLL dll = new DoubleLL();

Callers 1

mainMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected