We just learned about Heap sort in class today, and I am very confused as how it's considered so efficient - IE having O(nlogn).
- It's not memory efficient, since you have to build a heap representing the entire array and modify it constantly.
- It's not computationally efficient, since you have to find the max every time and bring it to the root.
I may just not understand heaps very well, but it all seems like a very roundabout way of doing Selection sort, yet somehow it's considered significantly more efficient... why is that the case?