class LNode:
def __init__(self, x):
self.data = x
self.next = None
def __repr__(self):
return self.data
def __str__(self):
return str(self.data)
def Reverse(head):
if head is None or head.next is None:
return
cur = head.next
next = cur.next
cur.next = None
pre = cur
cur = next
while cur.next != None:
next = cur.next
cur.next = pre
pre = cur
cur = next
cur.next = pre
head.next = cur
怎么填图示???