Giter VIP home page Giter VIP logo

Comments (25)

xxleyi avatar xxleyi commented on May 27, 2024

image
image

from learning_list.

xxleyi avatar xxleyi commented on May 27, 2024

image
image
image

from learning_list.

xxleyi avatar xxleyi commented on May 27, 2024

image

from learning_list.

xxleyi avatar xxleyi commented on May 27, 2024

image
image

from learning_list.

xxleyi avatar xxleyi commented on May 27, 2024

image

from learning_list.

xxleyi avatar xxleyi commented on May 27, 2024

image
image

from learning_list.

xxleyi avatar xxleyi commented on May 27, 2024

image

from learning_list.

xxleyi avatar xxleyi commented on May 27, 2024

image
image
三生三世中的一天,也就是一天中的一秒
image
整个宇宙中的三生三世,相当于三生三世中的 0.1s

from learning_list.

xxleyi avatar xxleyi commented on May 27, 2024

image

from learning_list.

xxleyi avatar xxleyi commented on May 27, 2024

image
image

from learning_list.

xxleyi avatar xxleyi commented on May 27, 2024

image

from learning_list.

xxleyi avatar xxleyi commented on May 27, 2024

image
image

from learning_list.

xxleyi avatar xxleyi commented on May 27, 2024

image

from learning_list.

xxleyi avatar xxleyi commented on May 27, 2024

image
image

from learning_list.

xxleyi avatar xxleyi commented on May 27, 2024

面试常见

image
image

from learning_list.

xxleyi avatar xxleyi commented on May 27, 2024

image
image

from learning_list.

xxleyi avatar xxleyi commented on May 27, 2024

几何级数与末项同阶

image

from learning_list.

xxleyi avatar xxleyi commented on May 27, 2024

image

from learning_list.

xxleyi avatar xxleyi commented on May 27, 2024

面试常见

image
image
image
image

from learning_list.

xxleyi avatar xxleyi commented on May 27, 2024

image
image
image

from learning_list.

xxleyi avatar xxleyi commented on May 27, 2024

动态规划:DSA 设计与优化的法宝,递归找思路,迭代找效率

image

from learning_list.

xxleyi avatar xxleyi commented on May 27, 2024

fab 数列的优化之路(面试常见)

image
从第零项开始,0 和 1 是平凡情况,之后依次取最后两项之和,呈现独有一套独有数列。


递推方程:
image


封底估算:
image
image
image


递归实例:
image
上台阶类比:一次走一个或两个台阶
image

ipython 中 fab?? 直接得到source code:

def fab(n):
    return n if n < 2 else (fab(n-2) + fab(n-1))

image

def fab(n):
    cache = {}
    def _fab(n):
        if n in cache:
            return cache[n]
        cache[n] = n if n < 2 else (_fab(n-2) + _fab(n-1))
        return cache[n]
    return _fab(n)
def fab(n):
    f, g = 0, 1
    if n < 2:
        return n
    while n > 1:
        f, g = g, f + g
        n -= 1
    return g

from learning_list.

xxleyi avatar xxleyi commented on May 27, 2024

最长公共子序列(面试常见)

image
image
image
image
leap of faith in recursion
image

理解

image

image

颠倒次序之后的迭代

image

from learning_list.

xxleyi avatar xxleyi commented on May 27, 2024

总结

  • 迭代、递归、动态规划:DSA 设计与优化的全部法宝
  • 对于某些在直觉上不好迭代求解的问题,可以先进行逆向递归求解
    • 递归求解的关键
      • 递归基
      • 信念飞跃(leap of faith)
  • 递归求解方案的正确性得到验证之后,分析整个递归过程,然后设计反向迭代算法

from learning_list.

xxleyi avatar xxleyi commented on May 27, 2024

补充

贪婪和回溯可以视为动态规划的特例

from learning_list.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.