heap
Java D-heap implementation - infinite loop in deleteMin()
This is my first time asking a question on here, and I\'ll do my best not to break any formal procedures.[详细]
2023-02-10 16:22 分类:问答Convert a maximum heap to a binary search tree
We are given an array of 2m - 1 distinct, comparable elements, indexed starting from 1. We can view the array as a complete binary tree:[详细]
2023-02-10 02:00 分类:问答Why hasn't sort_heap put the elements in the order I expected?
Given the following code: // range heap example #include <iostream> #include <algorithm> #include <vector>[详细]
2023-02-06 03:14 分类:问答Using a container/heap to implement a priority queue
In the big picture, I\'m trying to implement Dijkstra\'s algorithm using a priority queue. According to members of golang-nuts, the idiomatic way to do this in Go is to use the heap interface with a[详细]
2023-02-05 02:56 分类:问答MinMax Heap implementation without an array
I found lots of MinMax Heap implementations, that were storing data in an array. It is realy easy to implement, that is way I am looking for something different. I want to create a MinMax Heap using o[详细]
2023-02-04 03:32 分类:问答1-ary heap sort?
A while back we were given an assignment开发者_C百科 to write a c program that sorts an array of n numbers using a d-ary max-heap (a heap where each node has up to d children). The program needed to a[详细]
2023-01-29 23:02 分类:问答How can I heapify a heapq in O(lgn)? [duplicate]
This question already has answers here: Closed 12 years ago. Possible Duplicate: How can I implement decrease-key functionality in Python's heapq?[详细]
2023-01-29 19:21 分类:问答Percolate down/sift down a binary heap heuristic
Is there any optimizations in choosing which child node to percolate down in a binary heap?For example, in a min heap, if the parent no开发者_StackOverflowde was 10 and its children was 8 and 3 what w[详细]
2023-01-27 09:59 分类:问答Heap binary tree print method
In my assignment I know I am required to use my heap remove function which returns the variable to be printed. But the requirement in teh assignment is quite vague and I was curious if someone could g[详细]
2023-01-23 15:40 分类:问答C++ heap and ifstream read function
for my assignment I am building a heap, the data for the heap is coming from a file. One of the functions is to get the data, but I am having trouble understanding the ifstream read() function and am[详细]
2023-01-23 00:03 分类:问答