Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
[ACM-ICPC] Top-down & Bottom-up
Search
KuoE0
February 20, 2013
Programming
0
79
[ACM-ICPC] Top-down & Bottom-up
KuoE0
February 20, 2013
Tweet
Share
More Decks by KuoE0
See All by KuoE0
Protocol handler in Gecko
kuoe0
0
77
面試面試面試,因為很重要所以要說三次!
kuoe0
2
210
應徵軟體工程師
kuoe0
0
150
面試心得分享
kuoe0
0
390
Windows 真的不好用...
kuoe0
0
250
Python @Wheel Lab
kuoe0
0
180
Introduction to VP8
kuoe0
0
200
Python @NCKU_CSIE
kuoe0
0
95
[ACM-ICPC] Tree Isomorphism
kuoe0
1
220
Other Decks in Programming
See All in Programming
A Journey of Contribution and Collaboration in Open Source
ivargrimstad
0
930
レガシーシステムにどう立ち向かうか 複雑さと理想と現実/vs-legacy
suzukihoge
14
2.2k
Flutterを言い訳にしない!アプリの使い心地改善テクニック5選🔥
kno3a87
1
180
CSC509 Lecture 11
javiergs
PRO
0
180
[Do iOS '24] Ship your app on a Friday...and enjoy your weekend!
polpielladev
0
100
Creating a Free Video Ad Network on the Edge
mizoguchicoji
0
120
ECS Service Connectのこれまでのアップデートと今後のRoadmapを見てみる
tkikuc
2
250
Pinia Colada が実現するスマートな非同期処理
naokihaba
4
220
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
110
Snowflake x dbtで作るセキュアでアジャイルなデータ基盤
tsoshiro
2
520
Realtime API 入門
riofujimon
0
150
Enabling DevOps and Team Topologies Through Architecture: Architecting for Fast Flow
cer
PRO
0
330
Featured
See All Featured
StorybookのUI Testing Handbookを読んだ
zakiyama
27
5.3k
5 minutes of I Can Smell Your CMS
philhawksworth
202
19k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
329
21k
Being A Developer After 40
akosma
86
590k
How to train your dragon (web standard)
notwaldorf
88
5.7k
We Have a Design System, Now What?
morganepeng
50
7.2k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
0
96
A Tale of Four Properties
chriscoyier
156
23k
Embracing the Ebb and Flow
colly
84
4.5k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
Facilitating Awesome Meetings
lara
50
6.1k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
Transcript
Top-down & Bottom-up ֲࢸݢʢKuoE0ʣ
[email protected]
KuoE0.ch
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) http://creativecommons.org/licenses/by-sa/3.0/ Latest update: Feb
27, 2013
Top-down ሡେԽҝখɼ࠶ճᕧٻղɻ
Top-down ሡେԽҝখɼ࠶ճᕧٻղɻ
Top-down ሡେԽҝখɼ࠶ճᕧٻղɻ
Bottom-up ༝ቮղܾখɼஞ㑊ਪҠࢸେɻ
Bottom-up ༝ቮղܾখɼஞ㑊ਪҠࢸେɻ
Recursion қ༗ଠۃɼੋੜၷّɻၷّੜ࢛ɼ࢛ੜീ܋ɻʬқၚʭ ར༻ಉᒬతํ๏ෆᏗతࡉ҃ṧۙҊɻ
Fibonacci Sequence fib(5)
Fibonacci Sequence fib(5) fib(4) fib(3)
Fibonacci Sequence fib(5) fib(4) fib(3) fib(2) fib(3)
Fibonacci Sequence fib(5) fib(4) fib(3) fib(2) fib(2) fib(1) fib(3)
Fibonacci Sequence fib(5) fib(4) fib(3) fib(2) fib(2) fib(1) fib(0) fib(1)
fib(3)
Fibonacci Sequence fib(5) fib(4) fib(3) fib(2) fib(2) fib(1) fib(0) fib(1)
fib(3) 1 0 1
Fibonacci Sequence fib(5) fib(4) fib(3) fib(2) fib(2) fib(1) fib(0) fib(1)
fib(3) 1 0 1 1 2
Fibonacci Sequence fib(5) fib(4) fib(3) fib(2) fib(1) fib(2) fib(1) fib(0)
fib(0) fib(1) fib(3) 1 0 1 1 2
Fibonacci Sequence fib(5) fib(4) fib(3) fib(2) fib(1) fib(2) fib(1) fib(0)
fib(0) fib(1) fib(3) 1 0 1 1 2 1 0 1 3
Fibonacci Sequence fib(5) fib(4) fib(3) fib(2) fib(1) fib(2) fib(1) fib(0)
fib(0) fib(1) fib(2) fib(3) fib(1) 1 0 1 1 2 1 0 1 3
Fibonacci Sequence fib(5) fib(4) fib(3) fib(2) fib(1) fib(2) fib(1) fib(0)
fib(0) fib(1) fib(1) fib(2) fib(3) fib(0) fib(1) 1 0 1 1 2 1 0 1 3
Fibonacci Sequence fib(5) fib(4) fib(3) fib(2) fib(1) fib(2) fib(1) fib(0)
fib(0) fib(1) fib(1) fib(2) fib(3) fib(0) fib(1) 1 0 1 1 2 1 0 1 3 1 0 1
Fibonacci Sequence fib(5) fib(4) fib(3) fib(2) fib(1) fib(2) fib(1) fib(0)
fib(0) fib(1) fib(1) fib(2) fib(3) fib(0) fib(1) 1 0 1 1 2 1 0 1 3 1 0 1 1 2 5
int fib( int x ) { if ( x <=
0 ) return 0; if ( x == 1 ) return 1; return fib( x - 1 ) + fib( x - 2 ); } int main() { int ret = fib( 10 ); return 0; }
Iteration ಓੜҰɼҰੜೋɼೋੜࡾɼࡾੜᤈɻʬࢠʭ ෆᏗతར༻ቮɼ࣋᠃తٻग़݁ՌҎṧۙҊɻ
Fibonacci Sequence 0 1
Fibonacci Sequence 0 1 1
Fibonacci Sequence 0 1 1 2
Fibonacci Sequence 0 1 1 2 3
Fibonacci Sequence 0 1 1 2 3 5
int main() { int f0 = 0, f1 = 1,
f2; for ( int i = 0; i < 10; ++i ) { f2 = f0 + f1; f0 = f1, f1 = f2; } return 0; }
ᬇጯఱ্༗ɼຌਓጯᙛ༻ᅲɻ
POJ 1664 - ์ᣄՌ Practice Now
reference •http://www.csie.ntnu.edu.tw/~u91029/ IterativeRecursive.html
Thank You for Your Listening.