priority queues (heaps figure next two steps in deletemin figure last two steps in deletemin make sure not to assume that there are always two childrenso this usually involves an extra test in the code depicted in figure we've done this test at line one extremely tricky solution is always to ensure that your algorithm thinks every node has two children do this by placing sentinelof value higher than any in the heapat the spot after the heap endsat the start of each percolate down when the heap size is even you should think very carefully before attempting thisand you must put in prominent comment if you do use this technique although this eliminates the need to test for the presence of right childyou cannot eliminate the requirement that you test when you reach the bottombecause this would require sentinel for every leaf the worst-case running time for this operation is (log non averagethe element that is placed at the root is percolated almost to the bottom of the heap (which is the level it came from)so the average running time is (log nother heap operations notice that although finding the minimum can be performed in constant timea heap designed to find the minimum element (also known as (min)heapis of no help whatsoever in finding the maximum element in facta heap has very little ordering information