def enqueueWithPriority(self, value, priority):
idxInsert = 0
for itr in range(self.list.getSize()):
node = self.list.get(itr)
if node.getValue() == '':
idxInsert = itr
break
if node.getValue().getPriority() < priority:
idxInsert = itr
break
else:
idxInsert = itr + 1
self.list.insertAt( PriorityNode(value, priority), idxInsert )
list 사이즈 만큼 돌기 때문에 value가 비어있는 경우는 없을 거 같은데 if node.getValue()=='' 부분이 참이 되는 경우가 있는지 궁금합니다.
comment