Skip to content

Commit

Permalink
Update priority_queue.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ddangcong80 authored Mar 17, 2024
1 parent 2595bfa commit 4e622f0
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 @@ -35,11 +35,11 @@ def _sift_down(self, index):
smallest = index

if left_child_index < len(self.heap) and \
self.heap[left_child_index][0] > self.heap[smallest][0]:
self.heap[left_child_index][0] < self.heap[smallest][0]:
smallest = left_child_index

if right_child_index < len(self.heap) and \
self.heap[right_child_index][0] > self.heap[smallest][0]:
self.heap[right_child_index][0] < self.heap[smallest][0]:
smallest = right_child_index

if smallest != index:
Expand Down

0 comments on commit 4e622f0

Please sign in to comment.