TeX source:
O(n^2 \text{log } n )