On average.
Using the recurrence relation
T(n)= n - 1 + 1/n \sum_{i}(T(n-i)+T(i))
solving the relation, we get T(n) \in O(n).
On average.
Using the recurrence relation
T(n)= n - 1 + 1/n \sum_{i}(T(n-i)+T(i))
solving the relation, we get T(n) \in O(n).