HN
Hacker News
Top
New
Best
Ask
Show
Jobs
Comment by aboveandbeyond | Hacker News Reader
Parent
Full thread
aboveandbeyond
·
It's actually O(1). It's (N * (N+1))/2
View on HN
gregors
·
that's what I said "constant time"
Terr_
·
Your post is missing some required punctuation which would've made that easier to see.
randomthought
·
what about (n
(n+1)/2)< 1000
n^2 ? .
thedufer
·
He interpreted it as "the time complexity of computing the sum of the numbers from 1 to n", which using the formula you just gave takes O(1) time.
Reply on news.ycombinator.com