算法知识整理-Knowledge of Algorithm Summary-chap1

算法知识整理-Knowledge of Algorithm Summary

算法定义-Definition of Algorithm

算法:算法能够对一定规范输入,在有限时间内获得有效输出
Algorithm: algorithm is a step by step procedure, which defines a set of instructions to be executed in a certain order to get the desired output.

算法特征-Characteristic of Algorithm

  • 有穷性-Finiteness:
    Algorithm must terminate after a finite time of steps
  • 可行性-Feasibility:
    Algorithm should be feasible with the avaliable resources
  • 确定性-Unambiguous
    Each of its steps should be clear and must lead to only one meaning
  • 输入-Input
    Should have 0 or more well-defined inputs
  • 输出-Output
    Should have at least 1 well-defined outputs
  • 独立性-Independace
    Should be independent of any programming codes

数据结构中的算法-Algorithms in data structure

  • 搜索-Search
  • 排序-Sort
  • 插入-Insert
  • 删除-Delete
  • 更新-Update

算法复杂度-Algorithm Complexity

  • 时间复杂度
    • time factor:
      counting the numbers of key operations
      计算关键步骤所用的时间,如排序算法中的比较
    • time complexity
      the amount of time required by the algorithm to run to completion
      执行算法所需要的时间
    • Asymptotic Analysis & Asymptotic Notation
      Ways to calculate time complexity
      渐进性表示方法
      O ( n ) O(n) O(n) - upper bound
      Ω ( n ) \Omega(n) Ω(n) - lower bound
      θ ( n ) \theta(n) θ(n) - both upper and lower bound
  • 空间复杂度
    • space factor
      counting the maximum memory space required by the algorithm
    • space complexity
      the amount of memory space required by the algorithm in its life cycle
      • fixed part: independent of the size of the problem
      • variable part: depends on the size of the problem
        [example: dynamic memory allowcation, recursion stack space]
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值