Week 9 of the course

Self-study

The topics for this week are (i) The heap data structure, (ii) Implementing a heap as an array

The following links will take you to the video-lectures and the accompanying slides:

Heap and heap operations

In a max-heap having at least two nodes
A heap is a binary tree. Which of the following properties does a heap’s binary tree possess? (More than 1 property may be valid.)
Which of the following happens when we add a new node to a max-heap?
In which of the following situations would we need to use the Heapify algorithm in a max-heap?
Regarding the Buildheap algorithm, which of the following are true? (More than 1 statement may be true.)
What does the Heap-Extract-Max algorithm compute?
Consider the following four algorithms: Buildheap, Heap-Extract-Max, Heapify and Heap-Insert. Assume that the heap used as input to each algorithm has \(n\) nodes. Of these four algorithms, which have runtime efficiencies that are logarithmic in \(n\)?

A Heap as an array

Suppose a binary tree max-heap is stored in an array \(A\). Suppose \(A[i]\) corresponds to node \(x\). Which of the following are true? (More than one statement may be true.)
Of the following, what are the advantages of Heapsort as an algorithm for sorting numbers? (More than one statement may be true.)
Formulate a central question for the course, which this week’s videos will cover give the answer.
Which video topic should be discussed in particular in a discussion session?
Was there anything particularly difficult about the content of the videos? What about interesting? Something you’d like to learn more about?

Extra links on the topic:

Typically a priority queue is implemented as a binary tree heap. An alternative data structure that can be used for a priority queue is a binomial tree heap

Week09 - Glossary

Homework to be returned for the weekly exercises

Homework to be returned this week