单链表反转_python版

代码如下: class Node(object): def __init__(self, elem, next_=None): self.elem = elem self.next = next_ def reverseList(head): if head == None or head.next==None: # 若链表为空或者仅一个数就直
相关文章
相关标签/搜索