zoukankan      html  css  js  c++  java
  • final 1

    1. final重点

    divide and conquer; FFT; Greedy; dynamic peogramming; max flow

    2. 3 notations

    1) big O notation

    f(n) = O(g(n)) is an abbreviation for :"There exist positive constants c and n0 such that 0≤f(n)≤cg(n) for all n≥n0"

    上限

    2) Omega

    f(n)=Ω(g(n)) is an abbreviation for :"There exist positive constants c and n0 such that 0≤cg(n)≤f(n) for all n≥n0"

    等价于g(n)=O(f(n))

    下限

    3) Theta

    f(n)=Θ(g(n)) if and only if f(n)=O(g(n)) and f(n)=Ω(g(n)); thus, f(n) and g(n) have the same asymptotic growth rate

    相等

    3. Master theorem

    4. divide and conquer

    将一个难以直接解决的大问题,分割成一些规模较小的相同问题,分而治之

    步骤:1)将原问题分解成若干个规模较小,相互独立,与原问题形式相同的子问题

    2)递归的解决各个子问题

    3)将各个子问题的解合并为原问题的解

    可以类比为数学归纳法,找到解决本问题的求解方程公式,然后根据方程公式设计递归程序

    例题可以理解为,画一个田字格将图案分成4份,本来只有一个有洞,现在在中间放一个domino,变成四个部分均有一个洞,继而可以递归解决

  • 相关阅读:
    hdu 1042 N!
    hdu 1002 A + B Problem II
    c++大数模板
    hdu 1004 Let the Balloon Rise
    hdu 4027 Can you answer these queries?
    poj 2823 Sliding Window
    hdu 3074 Multiply game
    hdu 1394 Minimum Inversion Number
    hdu 5199 Gunner
    九度oj 1521 二叉树的镜像
  • 原文地址:https://www.cnblogs.com/eleni/p/13468864.html
Copyright © 2011-2022 走看看