1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
class : def __init__(self,data): self.data=data self.next=None def reverse(phead): if phead is None or phead.next==None: return phead last=None while phead: temp=phead.next phead.next=last last=phead phead=temp return last
|
近期评论