fast-power-algorithm
快速幂算法, 先贴一下算法模板,后边研究好了再贴研究心得,还有什么矩阵的快速幂算法
1 | int fastpow(int base, int n) { |
直接幂算法,在数值比较大的时候,在做算法题目的时候,时间复杂度不能接受
1 | int normalpow(int base, int n) { |
All articles on this blog are licensed under CC BY-NC-SA 4.0 unless otherwise stated.