單鏈表反轉_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: # 若鏈表爲空或者僅一個數就直
相關文章
相關標籤/搜索