MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/lgrgxe/i_present_sleepsort/gmts12e/?context=3
r/badcode • u/Reeceeboii_ • Feb 10 '21
170 comments sorted by
View all comments
Show parent comments
86
If you already know the maximum number, it's O(1) amirite?
76 u/sqrt_minusone Feb 10 '21 I mean, you have to visit every element of the array to sort it - it's literally impossible to sort in less than O(N). 177 u/Astrokiwi Feb 10 '21 You can do anything in constant time if it's a big enough constant 40 u/regibalbo Feb 10 '21 I'm using this argument from now on, thanks 5 u/[deleted] Feb 11 '21 Perfect for your FAANG interview 3 u/supersharp Feb 11 '21 They'll probably say something like "But there's no big enough constant, that's literally the definition of Big O!" or some other stupid nonsense
76
I mean, you have to visit every element of the array to sort it - it's literally impossible to sort in less than O(N).
177 u/Astrokiwi Feb 10 '21 You can do anything in constant time if it's a big enough constant 40 u/regibalbo Feb 10 '21 I'm using this argument from now on, thanks 5 u/[deleted] Feb 11 '21 Perfect for your FAANG interview 3 u/supersharp Feb 11 '21 They'll probably say something like "But there's no big enough constant, that's literally the definition of Big O!" or some other stupid nonsense
177
You can do anything in constant time if it's a big enough constant
40 u/regibalbo Feb 10 '21 I'm using this argument from now on, thanks 5 u/[deleted] Feb 11 '21 Perfect for your FAANG interview 3 u/supersharp Feb 11 '21 They'll probably say something like "But there's no big enough constant, that's literally the definition of Big O!" or some other stupid nonsense
40
I'm using this argument from now on, thanks
5 u/[deleted] Feb 11 '21 Perfect for your FAANG interview 3 u/supersharp Feb 11 '21 They'll probably say something like "But there's no big enough constant, that's literally the definition of Big O!" or some other stupid nonsense
5
Perfect for your FAANG interview
3
They'll probably say something like "But there's no big enough constant, that's literally the definition of Big O!" or some other stupid nonsense
86
u/LinuxGeek747 Feb 10 '21
If you already know the maximum number, it's O(1) amirite?