# 顺序表转化为链接表 def convert_to_LList(List): m=LList() for i in List[::-1]: m.prepend(i) return m List=[1,2,3] m=convert_to_LList(List) m.printall() # 链接表转化为顺序表 def convert_to_LList(LList): m=[] p=LList._head while p is not None: x=p.elem m.append(x) p=p.next return m l=convert_to_LList(m) print(l)