Comments (25)
from learning_list.
from learning_list.
from learning_list.
from learning_list.
from learning_list.
from learning_list.
from learning_list.
三生三世中的一天,也就是一天中的一秒
整个宇宙中的三生三世,相当于三生三世中的 0.1s
from learning_list.
from learning_list.
from learning_list.
from learning_list.
from learning_list.
from learning_list.
from learning_list.
面试常见
from learning_list.
from learning_list.
几何级数与末项同阶
from learning_list.
from learning_list.
面试常见
from learning_list.
from learning_list.
动态规划:DSA 设计与优化的法宝,递归找思路,迭代找效率
from learning_list.
fab 数列的优化之路(面试常见)
从第零项开始,0 和 1 是平凡情况,之后依次取最后两项之和,呈现独有一套独有数列。
ipython 中 fab?? 直接得到source code:
def fab(n):
return n if n < 2 else (fab(n-2) + fab(n-1))
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.
最长公共子序列(面试常见)
理解
颠倒次序之后的迭代
from learning_list.
总结
- 迭代、递归、动态规划:DSA 设计与优化的全部法宝
- 对于某些在直觉上不好迭代求解的问题,可以先进行逆向递归求解
- 递归求解的关键
- 递归基
- 信念飞跃(leap of faith)
- 递归求解的关键
- 递归求解方案的正确性得到验证之后,分析整个递归过程,然后设计反向迭代算法
from learning_list.
补充
贪婪和回溯可以视为动态规划的特例
from learning_list.
Related Issues (20)
- 给函数式程序员的 Hack Pipe:我如何学着停止担忧并爱上那顶小帽子 HOT 1
- 一文说透 TypeScript 的增删查改
- 重温 React hook 基本原理
- rust 中消失的三元去了哪里?
- 如何判断类型中是否有必填字段
- automate chrome by script kit
- applescript 踩坑经验
- hammerspoon 添加自定义菜单,执行 shell 脚本
- karabiner multitouch_extension
- 我的 Mac 使用实践总结
- 活久见之 JS 新见闻:return 写不写还是有关键区别的。
- Rust trait vs TypeScript interface
- React Final Form useFormValuesWatch
- data fetch in react
- type safe useParams
- finally, learn how generate struct with builtin function in Zig
- zig code: auto git push, find suitable target branch and open merge url in browser
- bun preloader for test
- depth protection and loose union
- 初步建立起 RSC 的直观体验 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from learning_list.