I'll take this post as an invitation to say other problems with complexity that I, personally, found unexpected.
First and closely related to sorting: computing the median (or say the 24th percentile boundary) is Θ(n). This is classic and now I'm used to it, but this really surprised me.
Second and close to me as a number theorist: computing the Nth prime can be done in o(N^{3/4}).
First and closely related to sorting: computing the median (or say the 24th percentile boundary) is Θ(n). This is classic and now I'm used to it, but this really surprised me.
Second and close to me as a number theorist: computing the Nth prime can be done in o(N^{3/4}).