public void reversePointers() throws Exception{
Node prev = this.head;
Node curr = prev.next;
while (curr != null){
Node ahead = curr.next;
curr.next = prev;
prev = curr;
curr = ahead;
}
//swap
Node temp = this.head;
this.head = this.tail;
this.tail = temp;
public void reversePointers() throws Exception{
Node prev = this.head;
Node curr = prev.next;
while (curr != null){
Node ahead = curr.next;
curr.next = prev;
prev = curr;
curr = ahead;
}
//swap
Node temp = this.head;
this.head = this.tail;
this.tail = temp;