Top "Max-heap" questions

Build a max heap for an array

I have a homework question that says: Problem 1: Given the array [ 22 | 25 | 71 | 24 | 18 | 5 | 27 | 32 | 104 | 8 | 23 | 66 ] Build a max-heap for the array. Show all steps …

algorithm heapsort max-heap
Can max/min heap trees contain duplicate values?

I'm wondering if a max or min heap tree is allowed to have duplicate values? I've been unsuccessful in trying …

java binary-tree heapsort min-heap max-heap
how to get the max heap in python

I use heapq module in python, I find I only can the min heap, even if I use reverse=True …

python heap max-heap
max heap and insertion

I have the an integer array of size 10. I need to draw the complete binary tree which I did. Now …

algorithm data-structures heap binary-tree max-heap
Inserting item into a Max Heap

I am not sure on how to insert an item into my max heap and then trickle up so the …

java insert heapsort max-heap
Find Element in Max Heap

I have a MaxPQ Heap that uses an array to store the elements. What is an algorithm I could use …

algorithm data-structures max-heap
Is there a maxheap in the C++ standard library?

I know the std::priority_queue class implements a minheap. Is there a way to use this as a Max …

c++ priority-queue c++-standard-library standard-library max-heap
Trying to understand max heapify

I tried watching http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-006-introduction-to-algorithms-fall-2011/lecture-videos/lecture-4-heaps-and-heap-sort/ to understand heaps and heapsort but …

algorithm sorting heap heapsort max-heap
Constructing Min/Max Binary Heap

Given an inorder-traversal list, what's the best way to create a Binary Min/Max Heap? I'm trying to confine with …

algorithm binary-heap min-heap max-heap