I know the complexity is O(nlog(n)). But why? How do you come to this answer?
Any help would be much appreciated, I'm very interested to know!