I have to evaluate the complexity of the following HeapSort algorithm (actually procedure "HeapSort"). Procedure fixHeap makes log(n) operations. In constructHeap it will be done r=n/2 times. So, we have log(n)*n/2 for first line. Next we will call fixHeap n-1 times, so (n-1)*log(n). And in the end we have log(n) * n/2 + log(n) * (n-1) = log(n) * (1,5*n - 1) ?
Am I right in this way or not? If not, tell me please how to evaluate this correctly. Thank you.
A - array, n - number of elements