Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

Heap Extract Max(int A[ ]) Si heapsize <1 entonces Mostrar underflow error max = A[1] A[1] = A[heapsize] heapsize = heapsize

1 Heapify(A, 1) Retornar max Heap Insert(int A[ ], dato) heapsize = heapsize + 1 i = heapsize Mientras i > 1 y A[Parent(i)] < dato Hacer A[i] = A[Parent(i)] i = Parent(i) A[i] = dato

You might also like