Skip to content

Commit

Permalink
Update priority_queue.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Kimbobae1 authored Mar 11, 2024
1 parent 5ea0167 commit 74c64d0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions priority_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ def pop(self):
self._swap(0, len(self.heap) - 1)
item = self.heap.pop()
self._sift_down(0)
return item
return item[1]
elif len(self.heap) == 1:
item = self.heap.pop()
return item
return item[1]
else:
return None

Expand Down

0 comments on commit 74c64d0

Please sign in to comment.