The art of computer programming chapter1
来源:互联网 发布:知世风涧澈 编辑:程序博客网 时间:2024/05/20 03:45
Algorithm:extended Euclidean algorithm and its implementation
Description of Algorithm :
Given two positive integers m and n, we compute their greatest common divisor d and two integer a and b such that am+bn=d.
step 1, (Initiation] Set a'=b=1, a=b'=0, c=m, d=n;
step 2, (Divide) Let q and r be the quotient and reminder respectively,of c divided by d
step 3, (Reminder zero?)If r=0,then algorithm terminates; we have in this case am+bn=d as desired
step 4, (Recycle)Set c=d. d=r, t=a', a'=a, a=t-qa, t=b'/b, b=t-qb, and go back to step 2
proof:
Click Here The proof of extended Euclidean algorithm and its implementation
implementation of the algorithm
First Method: use recursive method
Second Method: use non-recursive method
阅读全文
0 0
- The art of computer programming chapter1
- The Art of Computer Programming
- The Art of Computer Programming
- The Art of Computer Programming
- The Art of Computer Programming(TAOCP)
- 《The Art of Computer Programming》的PREFACE
- 读《计算机程序设计艺术》有感 The art of Computer Programming
- Art of Computer Programming 的学习 练习
- The Art of Unix Programming
- The Art of Multiprocessor Programming
- The art of good programming
- The Art of Unix Programming
- 5月1日买了《The Art of Computer Programming》
- 读书随记-The Art of Computer Programming-变长数组的分配策略(一)
- The art of computer programming Donald E. Knuth volumn one third edition读书笔记1
- The art of computer programming Donald E. Knuth volumn one third edition读书笔记2-1
- Reading The Art Of UNIX Programming Now
- 好书推荐 The Art of Unix Programming
- C++注释转化为C注释
- 【收藏】比较全的关于js获取css样式各种方法区别
- 240. Search a 2D Matrix II
- Spring Boot学习笔记----mybatis注解(一)
- java通过jdbc插入中文到mysql显示异常(问号或者乱码)
- The art of computer programming chapter1
- iptables
- 图的实验1——图的邻接矩阵存储实现
- BZOJ1066:蜥蜴(最大流)
- stm32_008_mdk创建工程注意事项
- samba案例及解决方案
- javascript实现对图片的随意拖拽,放大缩小
- 频谱分析误差表现在那几个方面
- LeetCode-010 Regular Expression Matching