









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
BuildHeap, Other Heap Operations, Heap code in C , Min heap, Lowers the value, Opposite of decreaseKey, Removes the node, General algorithm, Array, Binary tree are key points of this lecture and you can learn some other data structure terms.
Typology: Slides
1 / 16
This page cannot be seen from the preview
Don't miss anything!










i
i
Why I=n/2?
i
i
i
i
i
i
i
i
private:
int currentSize; // Number of elements in heap
eType array; // The heap array*
int capacity;
void percolateDown( int hole );
#include "Heap.h“
template
Heap
array = new etype[capacity + 1];
currentSize=0;
template
void Heap
if( isEmpty( ) ) {
return;
minItem = array[ 1 ];
array[ 1 ] = array[ currentSize-- ];
percolateDown( 1 );