We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
当链表当中self.__head.next 为None时,while循环调用node.next.data就会出错
`def delete_by_value(self, value): '''在链表中删除指定存储数据的Node节点. 参数: value:指定的存储数据 ''' if self.__head == None: # 如果链表是空的,则什么都不做 return
if self.__head.data == value: # 如果链表的头Node节点就是指定删除的Node节点 self.__head = self.__head.next pro = self.__head node = self.__head.next not_found = False while node.data != value: if node.next == None: # 如果已经到链表的最后一个节点,则表明该链表中没有找到执行Value值的Node节点 not_found == True break else: pro = node node = node.next if not_found == False: pro.next = node.next
`
The text was updated successfully, but these errors were encountered:
No branches or pull requests
当链表当中self.__head.next 为None时,while循环调用node.next.data就会出错
`def delete_by_value(self, value):
'''在链表中删除指定存储数据的Node节点.
参数:
value:指定的存储数据
'''
if self.__head == None: # 如果链表是空的,则什么都不做
return
`
The text was updated successfully, but these errors were encountered: