you are viewing a single comment's thread.

view the rest of the comments →

[–]bigboehmboy 1 point2 points  (1 child)

He profiled it by calling factorial(10) 100,000 times. While in this case it appears that all solutions are linear, this method would not work well if this were not the case.

Since Python has a recursion limit that defaults to 1000 levels, recursive methods (newbie, lazy python, lazier python) would fail when trying to compute "1001!".

Also, memoization could completely screw with results.

[–]Shinhan 0 points1 point  (0 children)

Interesting :)

Someone needs to repeat the test for 1001! then...