Category "heap"

heapify VS build heap

Can you please confirm the meaning of the concept 'heapify', the source I am learning from says that heapify is building a heap from an array (from scratch) Thi

how to convert binary heap sort to d_ary heap sort?

Hi I have an algorithm that uses binary tree to heapify and then sort the list i need to convert this sort algorithm to change into d-heap or d-ary heap or k-ar

Java PriorityQueue no way to initialize with a Collection and custom comparator?

I read through the implementation of Java PriorityQueue, the constructors it has are: PriorityQueue() PriorityQueue(Collection<? extends E> c) Priority

building a bottomUp heap

im trying to do a heap bottom up construction from Psuedo code from my text book however the output im getting is not a correct heap im getting out 2 9 8 6 5 7

(Python) Heapsort min heap implementation for Non Increasing Order Sorting. What am I doing wrong?

def min_heapify(A,k, n): left = 2*k +1 right = 2*k +2 n=int(len(A)) if left < n and A[left] < A[k]: smallest = left else: