/**
* 双向链表反转
*/
public class RevertDoubleNode {

public static class DoubleNode<T> {

public T value;

public DoubleNode pre;

public DoubleNode next;

public DoubleNode(T node) {
this.value = node;
}

}

public static DoubleNode revertDoubleNode(DoubleNode node) {
DoubleNode pre = null;
DoubleNode next = null;
while (node != null) {
next = node.next;
node.next = pre;
node.pre = next;
pre = node;
node = next;
}
return pre;
}

}