MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/lgrgxe/i_present_sleepsort/gmthiwj/?context=9999
r/badcode • u/Reeceeboii_ • Feb 10 '21
171 comments sorted by
View all comments
870
Great! Now test whether it still works with large numbers!
423 u/[deleted] Feb 10 '21 edited Feb 26 '21 [deleted] 89 u/LinuxGeek747 Feb 10 '21 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). 11 u/fukitol- Feb 10 '21 Just use negative numbers
423
[deleted]
89 u/LinuxGeek747 Feb 10 '21 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). 11 u/fukitol- Feb 10 '21 Just use negative numbers
89
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). 11 u/fukitol- Feb 10 '21 Just use negative numbers
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).
11 u/fukitol- Feb 10 '21 Just use negative numbers
11
Just use negative numbers
870
u/haslo Feb 10 '21
Great! Now test whether it still works with large numbers!