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

Method reverse

12_LinkedList.java/LL.java:138–150  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

136 }
137
138 public void reverse() {
139 Node prev = null;
140 Node curr = tail = head;
141 Node next;
142
143 while(curr != null) {
144 next = curr.next;
145 curr.next = prev;
146 prev = curr;
147 curr = next;
148 }
149 head = prev;
150 }
151
152 public void removeNthfromEnd(int n) {
153 //size

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected