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);