Should we merge all the factorial algorithms together? #2454
Replies: 2 comments 1 reply
-
Checking whether a number is a factorial is not quite the same as computing factorials (though it could be implemented in terms of computing factorials). Some implementations also seem to differ in whether they are recursive/iterative. I suppose this should be consolidated as follows:
|
Beta Was this translation helpful? Give feedback.
-
I get the points you made. After considering @appgurueu thoughts, here's a quick solution: Separate methods for factorial checking and calculation. Adding big O performance rating is a good call. |
Beta Was this translation helpful? Give feedback.
-
The factorial algorithms are either similar or just various implementations of a single algorithm
now this is not an issue, but it is a bit disorganized.
There are pros and cons to doing such a thing.
pros:
cons:
factorial algorithms
There might be more examples of algorithms in disarray lurking in unexplored directories
Beta Was this translation helpful? Give feedback.
All reactions