zoukankan      html  css  js  c++  java
  • 复杂度定义 The Definition of Complexity

    The upper bound   Big-O:

    Definition: f(n) is in O(g(n)) if there are constants c0 and N0 such that f(n) < c0*g(n) for all n>N0. We are only interested in large n, n>N0.

    (Heuristics)计算方法:删掉低阶变量(包括零阶),只保留最高阶变量,变量前的系数变为1。如15n2 + 33n + 17 is in O(n2),当然15n2 + 33n + 17 is in O(n3)也是对的,但我们通常只关心cloest bound。

    Dominance Relation: n! >>2n >> n>>  n2 >> nlogn >> n >> logn >> 1

    在Dominance Relation中忽略log的底,可以通过换底公式换成相同的底,且因为系数忽略,所以底不重要。

    (Arithmetic)计算方法:

    (截自Comp20003, University of Melbourne)

    The lower bound    Big-Omega(Ω):

    Definition: f(n) is Ω(g(n)) if g(n) is O(f(n))

    The tight bound / the growth rate   Big-Omega(Ω):

    Definition: f(n) is θ(g(n)) is f(n) is O(g(n)) and f(n) is Ω(g(n))

     

  • 相关阅读:
    C语言1博客作业03
    C语言1博客作业02
    C语言I博客作业08
    C语言I博客作业07
    C语言I博客作业06
    C语言I博客作业05
    C语言I博客作业04
    C语言I博客作业03
    C语言I博客作业02
    第一次作业(重做)
  • 原文地址:https://www.cnblogs.com/Will-zyq/p/10019646.html
Copyright © 2011-2022 走看看