Why this algorithm takes O(nlgn) time?
<p>In the , Chapter 5, 5.3 Randomized algorithms, </p>

<pre><code>   PERMUTE-BY-SORTING(A)
n = A.length
let P[1..n] be a new array
for i = 1 to n
P[i] = RANDOM(1, n^3)
sort A, using P as sort keys
</code></pre>

<p>Why the algorithm PERMUTE-BY-SORTING takes O(nlgn) time, please?</p>