Algorithm Analysis (CSC 301 2015F) : EBoards

CSC301.01 2015F, Class 17: Heap Sort


Overview

Preliminaries

Admin

Upcoming Work

Extra Credit

Academic

Peer

Exam 1

Questions

Is this Sam's normal: "Use any reasonable resource, but no posting questions?"

Yes.

Lower Bounds on Comparison-Based Sorting

n! leaves = Theta(2^(nlogn))

Weak proof by induction:

Base cases: n = 1, n = 2

Inductive cases:

Proof by Authority: According to famous people like Knuth, n! =~ 2^(nlogn)

The tree has 2^(nlogn) leaves. The minimum height of a tree with k leaves is log(k). So, the tree has minimum height log(2^(nlogn)) = nlogn.

Background

Heaps

Key ideas:

Inserting into Heaps

Removing from Heaps

Heap Sort