Python:math.factorial是否被记忆? [英] Python: Is math.factorial memoized?
本文介绍了Python:math.factorial是否被记忆?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在以三种不同的方式解决问题,其中两种是递归的,我自己会记住它们。另一个不是递归的,但是使用math.factorial。我需要知道是否需要添加显式的备注。
I am solving a problem in three different ways, two are recursive and I memoize them myself. The other is not recursive but uses math.factorial. I need to know if I need to add explicit memoization to it.
谢谢。
推荐答案
在此链接上搜索math_factorial,您将在python中找到其实现:
Search for math_factorial on this link and you will find its implementation in python:
http://svn.python.org/view/python/trunk/Modules/mathmodule.c?view=markup
PS这是针对python2.6
P.S. This is for python2.6
这篇关于Python:math.factorial是否被记忆?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文