zoukankan      html  css  js  c++  java
  • The Art Of Computer Programming: 1.1

    The Art Of Computer Programming: 1.1

    Table of Contents

    1 Algorithm

    1.1 算法的特性

    算法除了是一套有限的规则 (Being a finite set of rules) 之外,还有如下的五个特性:

    • 有限性 (Finiteness) :需要在有限的步骤内收敛结束。
    • 可定义性 (Definieness) :算法中的每一步骤必要要有精确的定义。
    • 输入 (input) :有 0 或者多数输入
    • 输出 (output) :有 1 或者多个输出
    • 有效性 (Effectiveness) :算法通常是有效的。

    1.2 例子

    ea.png

    Figure 1: Euclid's alrogithm

    Lisp code:

    (defun ea (m n)
      "Euclid's algorithm"
      (interactive)
      (let ((r (% m n)))
        (if (= r 0)
            n
          (ea n r))))
    
  • 相关阅读:
    TCP协议详解-IPv4
    welcome to my cnblog
    怎样解决闭包造成的内存泄漏
    跳转路由后请求失败
    vant grid组件图片加载问题
    3次握手
    res.send()传参----Invalid status code: 1
    堆栈总结
    jQuery实现全选
    phpstudy_pro打开MySQL服务,一闪一闪的
  • 原文地址:https://www.cnblogs.com/yangyingchao/p/3941653.html
Copyright © 2011-2022 走看看