问题描述
这是我的代码,但出队时似乎删除了任何随机值。为什么会这样呢? 谢谢
class Node:
def __init__(self,data):
self.data = data
self.next = None
class CircularLinkedlist:
def __init__(self):
self.head = None
self.size = 0
def dequeue(self):
if self.is_empty():
print('List is Empty')
else:
if self.size == 1:
self.head = None
self.size -=1
else:
pos = self.head.next
self.head = pos
self.head.next = pos.next.next
self.size -=1
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)