Comments on: Algorithms in PHP: Priority Queues (and Heaps) https://withinboredom.info/2022/09/04/algorithms-in-php-priority-queues-and-heaps/ A Site About Stuff Wed, 26 Jun 2024 18:14:07 +0000 hourly 1 https://wordpress.org/?v=6.7.1 By: Rye https://withinboredom.info/2022/09/04/algorithms-in-php-priority-queues-and-heaps/#comment-128 Tue, 06 Sep 2022 16:36:14 +0000 https://withinboredom.info/?p=4576#comment-128 getMax uses index 0. This is not the current value, but always the first inserted one.

The getSize function only gives the count of the keys.
When you inserting two values with the same key, the count would be wrong

removeMax does not remove the value, only when the pointer has reached the end.

Your test does not test for any of these things.

]]>
By: Nick Poulos https://withinboredom.info/2022/09/04/algorithms-in-php-priority-queues-and-heaps/#comment-127 Mon, 05 Sep 2022 22:22:57 +0000 https://withinboredom.info/?p=4576#comment-127 Cool article, looking forward to the next.

]]>
By: Kamran https://withinboredom.info/2022/09/04/algorithms-in-php-priority-queues-and-heaps/#comment-126 Mon, 05 Sep 2022 19:45:06 +0000 https://withinboredom.info/?p=4576#comment-126 Very informative and interesting brother. Keep it up.

]]>
By: Craig https://withinboredom.info/2022/09/04/algorithms-in-php-priority-queues-and-heaps/#comment-125 Mon, 05 Sep 2022 02:02:39 +0000 https://withinboredom.info/?p=4576#comment-125 Great example, thanks!

]]>