Lecture 23

We defined the abstract data type called a "priority queue" and then discussed a particular implementation of it called a "binary heap." We noted that these heaps could be represented implicitly (i.e. without the usual tree representation using a bunch of pointers).

We gave the sift-down and sift-up operations and showed how to do MIN, EXTRACT_MIN, and INSERT in O(1), O(lg n), and O(lg n), respectively. We also looked at the MAKE_HEAP operation and showed (via some tricky summing) that it ran in linear time.