From f74ca3cfc64b48e5d62bf66b6864598a060da722 Mon Sep 17 00:00:00 2001 From: HyeonCheol1211 <68327292+HyeonCheol1211@users.noreply.github.com> Date: Mon, 11 Mar 2024 17:54:20 +0900 Subject: [PATCH] Update priority_queue.py --- priority_queue.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/priority_queue.py b/priority_queue.py index 6994ec7..7e0f321 100644 --- a/priority_queue.py +++ b/priority_queue.py @@ -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: