From 2fa18a094fc1b939013dd803b07904b2f2b1ea7c Mon Sep 17 00:00:00 2001 From: Jidong Xiao Date: Tue, 22 Apr 2025 19:36:01 -0400 Subject: [PATCH] fixing the comments --- lectures/24_priority_queues_II/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lectures/24_priority_queues_II/README.md b/lectures/24_priority_queues_II/README.md index bcc4fdf..a6b6f40 100644 --- a/lectures/24_priority_queues_II/README.md +++ b/lectures/24_priority_queues_II/README.md @@ -142,8 +142,8 @@ void heapify(std::vector& nums, int n, int i){ smallest = right; } - // after the above, smallest basically will either stay the same, or will be either left or right, depending on nums[left] is larger or nums[right] is larger. largest stays the same if it is already larger than its two children. - // if largest is changed, then we do need to swap. + // after the above, smallest basically will either stay the same, or will be either left or right, depending on nums[left] is smaller or nums[right] is smaller. smallest stays the same if it is already smallest than its two children. + // if smallest is changed, then we do need to swap. if(smallest != i){ std::swap(nums[i], nums[smallest]); heapify(nums, n, smallest);