Skip to main content

Questions tagged [heap]

A heap is a tree-based data structure that satisfies the heap property. For questions about memory allocated from the system heap, use the [memory-management] tag.

7 votes
4 answers
552 views

I developed a heap sort variant that sorts a heap through traversal. Unlike in the standard heap sort, the algorithm does not remove the min element from the heap instead it traverses all the nodes of ...
ariko stephen's user avatar
4 votes
2 answers
317 views

Description I've written a heap allocator in C++ using an explicit free list for organization. I've also written a series of unit tests and a microbenchmark using Catch2. At time of writing I've ...
pdm's user avatar
  • 307
15 votes
5 answers
4k views

I have tried to implement my Heap in C. The following are the 13 operations defined: build_maxheap insert exctract_max (delete heap max root) max_delete (delete an element or key) max_heapify clear ...
V_head's user avatar
  • 575
5 votes
1 answer
108 views

This is my very first data structure written in Perl for a d-ary heap: ...
coderodde's user avatar
  • 32.2k
5 votes
2 answers
744 views

I wrote a binary heap structure class in C++. It is a templated class with a comparison type as one of the template parameters to allow for a min or max heap. I have not written anything in C++ in a ...
mastmartelli's user avatar
2 votes
1 answer
244 views

I am trying to determine the correctness of a helper method within my MaxHeap class. The goal of this helper method is, given the index of any node in the Max Heap, sink it to the correct level in the ...
MPC's user avatar
  • 61
8 votes
1 answer
500 views

I'm learning Rust by implementing basic data structures and algorithms. I implemented a binary heap (max heap): ...
ryanzidago's user avatar
2 votes
1 answer
308 views

While working on the following leetcode problem: https://leetcode.com/problems/top-k-frequent-elements/ I used a Priority Queu implementation in Ruby. I have learned how to implement a Priority Queu ...
Steven Aguilar's user avatar

15 30 50 per page
1
2 3 4 5
11