University of California, Santa Cruz

Prof. Paulo Franca - Spring 2000

Introduction

Syllabus

Guidelines for labs

Lab sections

Take quiz & check grades

Build Heap procedure:

Algorithm:

Build Heap(A)
A.heapsize = A.length;
for  i= A.length /2   downto 1
     Heapify(A,i)

Explanation:

Assuming all the records are in the heap structure but they do not respect the heap property;

Start from bottom up fixing heaps as you go.

Comments:

What is the running time ?