# Proof of Quicksort's average time complexity

I have been trying to understand average time complexity of quicksort by going through this link

But I am not able to understand the step where $$\sum_{k=0}^{n-1} Q_k = \sum_{k=0}^{n-1} Q_{n-1-k}$$

How are these two equal?

• This is just change of variable. You're summing over $Q_0, Q_1, \dots, Q_{n-1}$ in the first sum, and $Q_{n-1}, Q_{n-2}, \dots, Q_1, Q_0$ in the second. – stochasticboy321 Oct 17 '15 at 4:18
• ohh.. thanks :) – vishnu viswanath Oct 17 '15 at 4:21