MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/pbt54y/yx4/haeqqfi/
r/badcode • u/[deleted] • Aug 26 '21
80 comments sorted by
View all comments
Show parent comment
28
I'm assuming this is for worst case, then what's the big-O for best case
29 u/bean710 Aug 26 '21 O(shit) 5 u/[deleted] Aug 26 '21 O(mfg) 20 u/pcuser42 Aug 26 '21 O(wtf) 8 u/[deleted] Aug 26 '21 O(wtf) 15 u/[deleted] Aug 26 '21 Ω(wtf) 11 u/[deleted] Aug 26 '21 Θ(wtf) 25 u/jordandwalters Aug 26 '21 O(no) 8 u/iamafraazhussain Aug 26 '21 edited Aug 26 '21 O(wtfrip) 20 u/bargle0 Aug 26 '21 It’s O(1), since all the ranges are constant.Let this be a lesson that asymptotic behavior isn’t everything.
29
O(shit)
5 u/[deleted] Aug 26 '21 O(mfg)
5
O(mfg)
20
O(wtf)
8 u/[deleted] Aug 26 '21 O(wtf) 15 u/[deleted] Aug 26 '21 Ω(wtf) 11 u/[deleted] Aug 26 '21 Θ(wtf) 25 u/jordandwalters Aug 26 '21 O(no) 8 u/iamafraazhussain Aug 26 '21 edited Aug 26 '21 O(wtfrip)
8
15 u/[deleted] Aug 26 '21 Ω(wtf) 11 u/[deleted] Aug 26 '21 Θ(wtf) 25 u/jordandwalters Aug 26 '21 O(no) 8 u/iamafraazhussain Aug 26 '21 edited Aug 26 '21 O(wtfrip)
15
Ω(wtf)
11 u/[deleted] Aug 26 '21 Θ(wtf) 25 u/jordandwalters Aug 26 '21 O(no) 8 u/iamafraazhussain Aug 26 '21 edited Aug 26 '21 O(wtfrip)
11
Θ(wtf)
25 u/jordandwalters Aug 26 '21 O(no) 8 u/iamafraazhussain Aug 26 '21 edited Aug 26 '21 O(wtfrip)
25
O(no)
8 u/iamafraazhussain Aug 26 '21 edited Aug 26 '21 O(wtfrip)
O(wtfrip)
It’s O(1), since all the ranges are constant.
Let this be a lesson that asymptotic behavior isn’t everything.
View all comments
Show parent comment
28
u/[deleted] Aug 26 '21
I'm assuming this is for worst case, then what's the big-O for best case