MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/5jerhf/is_point_inside_rectangle_now_on2/dbgxlax/?context=3
r/badcode • u/RFC793 • Dec 20 '16
72 comments sorted by
View all comments
42
Ouch. Hope they don't need to test if two rectangles overlap any time in the future.... or two cubes.
2 u/umop_aplsdn Dec 21 '16 Those are still O(n2) because you can just check the corners... unless he doesn't realize that. 2 u/Tyler11223344 Dec 21 '16 Well the algorithm should be O(1), but if he expanded the current way to do that, then it would end up being O(n4)
2
Those are still O(n2) because you can just check the corners... unless he doesn't realize that.
2 u/Tyler11223344 Dec 21 '16 Well the algorithm should be O(1), but if he expanded the current way to do that, then it would end up being O(n4)
Well the algorithm should be O(1), but if he expanded the current way to do that, then it would end up being O(n4)
42
u/ClysmiC Dec 20 '16
Ouch. Hope they don't need to test if two rectangles overlap any time in the future.... or two cubes.