Top "Min-heap" questions

Priority queue for user-defined types

I have the below struct struct node{ float val; int count; } I have several objects of this struct. Now, I …

c++ priority-queue min-heap
Min Heapify method- Min heap algorithm

I am trying to build a min heap. I have already done the insert, delete,swap, up-heap, down-heap and it …

java algorithm heap min-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
Comparator for min-heap in C++

I am trying to make a min-heap1 of longs in C++ using the STL make_heap, etc., but my comparator …

c++ stl heap comparator min-heap
easy way to maintain a min heap with stl?

for user defined struct, as I understand, it's easy. Just overload the operator <. However, for int/float etc.., do …

c++ stl heap min-heap
How to update elements within a heap? (priority queue)

When using a min/max-heap algorithm, priorities may change. One way to handle this is to removal and insert the …

algorithm priority-queue insert-update min-heap
Implementing Min Heap in C - using array?

I am trying to learn and implement a min-heap to solve a problem: Loop that creates doubles and insert them …

c binary-tree min-heap
Java, Finding Kth largest value from the array

I had an interview with Facebook and they asked me this question. Suppose you have an unordered array with N …

java arrays algorithm min-heap
Creating Min Heap from STL Priority Queue

I am creating a min heap from stl priority queue. Here is my class which I am using. class Plane { …

c++ priority-queue min-heap
Dijkstra algorithm. Min heap as a min-priority queue

I'm reading about Dijkstra's algorithm in CLRS, Third Edition (p. 662). Here is a part from the book I don't understand: …

heap priority-queue dijkstra min-heap