Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
School-Cotton
· 4y ago · 0 comments
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.
Comments
[–]
mountainreason
4y ago
Yeah. I know. Why would the data already be sorted?
[–]
School-Cotton
OP
4y ago
In a database you might have already built an index on that data.