Comment

Comment by School-Cotton

Yes, if the data is not already sorted. Thus it's O(n) for already sorted data and O(n log(n) + n) -- which simplifies to O(n log(n)) -- for arbitrary data.

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton