#File Name : 反转双向链表.py
class Node(object):
def __init__(self,value):
self.next = None
self.pre = None
self.value = value
def reverseList(self,head_node):
pre = None
while head_node!=None:
next = head_node.next
head_node.next = pre
head_node.pre = next
pre = head_node
head_node = next
return pre
思路与反转单向一样