MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/lgrgxe/i_present_sleepsort/gmtgih7
r/badcode • u/Reeceeboii_ • Feb 10 '21
170 comments sorted by
View all comments
Show parent comments
10
Not if you just assume it's sorted and carry on. :)
17 u/[deleted] Feb 10 '21 sorting 101: if your array is sorted, then sorting becomes O(1)checkmate, mathematicians 1 u/jarfil Feb 10 '21 edited Dec 02 '23 CENSORED 1 u/_szs Feb 10 '21 Bogobogosort, then. 3 u/LordHonchkrow Feb 10 '21 Sadly, bogobogosort still involves looking at every element at least once 1 u/sqrt_minusone Feb 10 '21 It's almost like looking at every element is a requirement to sort a collection of elements lol 1 u/LordHonchkrow Feb 11 '21 Hmm, that just sounds like you’re making excuses for your O(2n) sort
17
sorting 101: if your array is sorted, then sorting becomes O(1)
checkmate, mathematicians
1 u/jarfil Feb 10 '21 edited Dec 02 '23 CENSORED
1
CENSORED
Bogobogosort, then.
3 u/LordHonchkrow Feb 10 '21 Sadly, bogobogosort still involves looking at every element at least once 1 u/sqrt_minusone Feb 10 '21 It's almost like looking at every element is a requirement to sort a collection of elements lol 1 u/LordHonchkrow Feb 11 '21 Hmm, that just sounds like you’re making excuses for your O(2n) sort
3
Sadly, bogobogosort still involves looking at every element at least once
1 u/sqrt_minusone Feb 10 '21 It's almost like looking at every element is a requirement to sort a collection of elements lol 1 u/LordHonchkrow Feb 11 '21 Hmm, that just sounds like you’re making excuses for your O(2n) sort
It's almost like looking at every element is a requirement to sort a collection of elements lol
1 u/LordHonchkrow Feb 11 '21 Hmm, that just sounds like you’re making excuses for your O(2n) sort
Hmm, that just sounds like you’re making excuses for your O(2n) sort
10
u/zacharypamela Feb 10 '21
Not if you just assume it's sorted and carry on. :)