Q : What is the running time of heap sort for presorted input of size n?
- O(n) B) O(n^2) C) O(nlogn) D) O(logn)
In the question they didn’t mention if its a max or min heap and also they didn’t mention if the “presorted” input is in ascending or descending order.
For example, if we take max heap, if the order of input is decreasing order, the time complexity would be O(n) and for decresing order it would be O(nlogn).
Is the question incomplete or am i missing some concepts?