Lecture 17 Ticket

Complete by the beginning of class on 10/14

Download this ticket in pdf format or .tex source.

Suppose the elements \(7, 3, 2, 6, 8, 1, 5, 4\) are added added to a binary (min) heap in that order. Compute the array representing the resulting heap. Show your work.

Solution

The resulting array is [1 4 2 6 8 3 5 7]. Here’s the derivation: