Re:CoffeePhysics: A JS/CS Physics Engine
by HardyLeung on Wednesday February 29, 2012 @12:47PM
(#3648807)
I think you need to revisit your understand of complexity. It is O(N^2). If you want the exact count, it is N(N-1)/2. N! is an exceedingly large number even for very small N.
[ Parent
| on HN ]
Re:CoffeePhysics: A JS/CS Physics Engine
by nlogn on Wednesday February 29, 2012 @09:58PM
(#3650736)
Yep I'm wrong. Mixed up factorial just like mistercow said. Thanks for the corrections. And here I was worrying that someone would complain that my loop wouldn't address the issues of collision response necessitating more checks, thus making a recursive solution necessary.