Java实现双链表的反转
public static class DoubleNode {
public int value;
public DoubleNode last;
public DobleNode next;
public DoubleNode(int data) {
this.val = data;
}
}
public static DoubleNode reverseDoubleList(DoubleNode head){
DoubleNode pre=null;
DoubleNode next=null;
while(head != null){
next=head.next;
head.next=pre;
head.last=next;
pre=head;
head=next;
}
return pre;
}

