知识卡片
模幂复杂度取决于指数位数
书中递归模幂对β位指数进行O(β)次算术操作;若每次β位乘除按朴素方法计O(β²)位操作,总上界为O(β³)。
复杂度应按输入位数衡量,不能把大整数乘法视为常数。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 第31章 数论算法 · 查看原书依据
The total number of recursive calls depends on the number of bits of b and the values of these bits. Assume that b > 0 and that the most significant bit of b is a 1. Each 0 generates one recursive call (in line 4), and each 1 generates two recursive calls (one in line 6 followed by one in line 4 because if b is odd, then b − 1 is even). If the inputs a, b, and n are β-bit numbers, then there are between β and 2β − 1
参考来源
- 位置:《算法导论(第4版)》第31章《数论算法》(OEBPS/chapter031.xhtml,文本字符[55000,60000))。
- 结论依据:原文对中国剩余定理、模幂性质或重复平方法给出定理与算法;公式图已核对。
- 原始内容:The total number of recursive calls depends on the number of bits of b and the values of these bits. Assume that b > 0 and that the most significant bit of b is a 1. Each 0 generates one recursive call (in line 4), and each 1 generates two recursive calls (one in line 6 followed by one in line 4 because if b is odd, then b − 1 is even). If the inputs a , b , and n are β -bit numbers, then there are between β and 2 β − 1