Top "Binary-heap" questions

How to remove element not at top from priority_queue?

In my program I need to delete an element from a priority queue that is not at the top. Can …

c++ stl priority-queue binary-heap
Max-Heapify A Binary Tree

This is one of the interview questions I recently came across. Given the root address of a complete or almost …

algorithm data-structures heap binary-tree binary-heap
Real world applications of Binary heaps and Fibonacci Heaps

What are the real world applications of Fibonacci heaps and binary heaps? It'd be great if you could share some …

algorithm data-structures binary-heap fibonacci-heap
Finding last element of a binary heap

quoting Wikipedia: It is perfectly acceptable to use a traditional binary tree data structure to implement a binary heap. There …

algorithm data-structures binary-tree binary-heap
how to determine if the kth largest element of the heap is greater than x

Consider a binary heap containing n numbers (the root stores the greatest number). You are given a positive integer k &…

algorithm complexity-theory binary-heap
What is the difference between binary heaps and binomial heaps?

I need to know the main difference between binary and binomial heaps regardless of the their structure difference that binary …

algorithm data-structures priority-queue binary-heap binomial-heap
Efficient heaps in purely functional languages

As an exercise in Haskell, I'm trying to implement heapsort. The heap is usually implemented as an array in imperative …

haskell functional-programming binary-heap heapsort purely-functional
How many comparisons does 8 element Binary Heap need?

This is a homework question, and I'm asked to show that 8 element Binary Heap needs 8 comparisons. but when I use …

algorithm data-structures heap binary-heap
How can std::make_heap be implemented while making at most 3N comparisons?

I looked in to the C++0x standard and found the requirement that make_heap should do no more than 3*…

c++ algorithm stl big-o binary-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