How can building a heap be O(n) time complexity?
I think there are several questions buried in this topic: How do you implement buildHeap so it runs in O(n) time? How do you show that buildHeap runs in O(n) time when implemented correctly? Why doesn’t that same logic work to make heap sort run in O(n) time rather than O(n log n)? How do … Read more