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

Method reverse

12_LinkedList.java/DLL.java:56–68  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

54 }
55
56 public void reverse() {
57 Node curr = head;
58 Node prev = null;
59 Node next;
60 while(curr != null) {
61 next = curr.next;
62 curr.next = prev;
63 curr.prev = next;
64 prev = curr;
65 curr = next;
66 }
67 head = prev;
68 }
69 public static void main(String args[]) {
70 DLL dll = new DLL();
71 dll.addFirst(3);

Callers 1

mainMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected