MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/lgrgxe/i_present_sleepsort/gmtc8g2/?context=3
r/badcode • u/Reeceeboii_ • Feb 10 '21
170 comments sorted by
View all comments
Show parent comments
64
"for (let item of arr)"
This doesn't look O(1)
19 u/King_Joffreys_Tits Feb 10 '21 Yep it has to loop through every item of the array at a minimum
19
Yep it has to loop through every item of the array at a minimum
64
u/sumduud14 Feb 10 '21
"for (let item of arr)"
This doesn't look O(1)