Re:Hiring the Smartest People in the World
by hristov on Wednesday May 02, 2012 @06:27AM
(#3918346)
The second solution works in linear time only if one assumes that multiplication is a constant time operation. But is it really? If you look at how a processor does multiplication it becomes clear it is a O(log n) operation where n is one of the numbers being multiplied. Thus, the second solution is probably a O(nlogn) solution.
[ Parent
| on HN ]
Re:Hiring the Smartest People in the World
by alexchamberlain on Wednesday May 02, 2012 @06:30AM
(#3918358)
It also requires one to assume n! can be computed. Factorials get huge very quickly.