java.math库中Math.cbrt(a)方法的时间复杂度 [英] Time complexity of the Math.cbrt(a) method in java.math library
问题描述
我已经编写了Java代码,用于使用math.cbrt(a)
函数查找出租车编号.我假设math.cbrt(a)
的复杂度是恒定的.我真的很想知道这个函数的复杂性,这样我就可以知道我的算法的效果如何.
访问查找出租车编号
I have written java code for finding taxicab numbers using math.cbrt(a)
function. I assumed the complexity of math.cbrt(a)
is constant. I am really interested in knowing the complexity of this function such that I can know how good my algorithm works.
Visit Finding taxicab Numbers
推荐答案
此方法是本地方法,因此确切的调用取决于VM的实现. 例如. OpenJDK使用fdlibm,您可以在此处检查 http://hg.openjdk.java.net/jdk7/jdk7/jdk/file/9b8c96f96a0f/src/share/native/java/lang/StrictMath.c
This method is native, so exact call depends on VM implementation. Eg. OpenJDK use fdlibm as you can check here http://hg.openjdk.java.net/jdk7/jdk7/jdk/file/9b8c96f96a0f/src/share/native/java/lang/StrictMath.c
和fdlibm实现在这里 http://www.netlib.org/fdlibm/s_cbrt.c 似乎是恒定的.
and fdlibm implementation is here http://www.netlib.org/fdlibm/s_cbrt.c which seems to be constant.
这篇关于java.math库中Math.cbrt(a)方法的时间复杂度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!