随笔分类 - CLRS(算法导论)
摘要:Ex2.1-4Problem description:Input: two arrays lhs and rhs which store two n-bit binary numbers respectivelyOutput: one array that stores an n+1-bit bin...
阅读全文
摘要:使用Scheme的对数迭代法:#lang racket;;N是偶数:b^n = (b^(n/2))^2(define (square x) (* x x));定义乘积函数(define (fast-expt b n);筛选 (expt-iter b n 1))(define (expt-iter ...
阅读全文

浙公网安备 33010602011771号