33,007
社区成员
发帖
与我相关
我的任务
分享
def VisitElementByNext(self,tNode):
if tNode != None:
print(tNode.data,'->',end="")
def TraverseElement(self):
cNode = self.head
print("按next域遍历带头结点双链表:")
if self.IsEmpty():
print("Empty")
return
while cNode.next != None:
cNode = cNode.next
#print(cNode.data,'->',end="")
#为什么上面用这句话不行?而需要调用函数,为什么还需要判断一下cNode不为空呢?
self.VisitElementByNext(cNode)
print("None")