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
Merge Sort
Search
KuoE0
March 05, 2013
Programming
1
9.4k
Merge Sort
KuoE0
March 05, 2013
Tweet
Share
More Decks by KuoE0
See All by KuoE0
Protocol handler in Gecko
kuoe0
0
95
面試面試面試,因為很重要所以要說三次!
kuoe0
2
240
應徵軟體工程師
kuoe0
0
160
面試心得分享
kuoe0
0
400
Windows 真的不好用...
kuoe0
0
280
Python @Wheel Lab
kuoe0
0
200
Introduction to VP8
kuoe0
0
240
Python @NCKU_CSIE
kuoe0
0
120
[ACM-ICPC] Tree Isomorphism
kuoe0
1
240
Other Decks in Programming
See All in Programming
『自分のデータだけ見せたい!』を叶える──Laravel × Casbin で複雑権限をスッキリ解きほぐす 25 分
akitotsukahara
1
510
PHPで始める振る舞い駆動開発(Behaviour-Driven Development)
ohmori_yusuke
2
180
git worktree × Claude Code × MCP ~生成AI時代の並列開発フロー~
hisuzuya
1
460
AWS CDKの推しポイント 〜CloudFormationと比較してみた〜
akihisaikeda
3
310
今ならAmazon ECSのサービス間通信をどう選ぶか / Selection of ECS Interservice Communication 2025
tkikuc
19
3.5k
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
46
30k
Create a website using Spatial Web
akkeylab
0
300
ニーリーにおけるプロダクトエンジニア
nealle
0
360
エンジニア向け採用ピッチ資料
inusan
0
160
生成AIコーディングとの向き合い方、AIと共創するという考え方 / How to deal with generative AI coding and the concept of co-creating with AI
seike460
PRO
1
330
プロダクト志向ってなんなんだろうね
righttouch
PRO
0
160
LT 2025-06-30: プロダクトエンジニアの役割
yamamotok
0
340
Featured
See All Featured
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
8
670
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
130
19k
Reflections from 52 weeks, 52 projects
jeffersonlam
351
20k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.3k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
26k
The Power of CSS Pseudo Elements
geoffreycrofte
77
5.8k
YesSQL, Process and Tooling at Scale
rocio
173
14k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
657
60k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Documentation Writing (for coders)
carmenintech
71
4.9k
Facilitating Awesome Meetings
lara
54
6.4k
A Modern Web Designer's Workflow
chriscoyier
694
190k
Transcript
Merge Sort ֲࢸݢʢ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: Mar
6, 2013
Traditional Merge Sort
Algorithm ࠾༻ divide & conquer ࡦུ
Divide ሡᙛલᏐྻሣׂᬇਐߦ ౸ᷮႫҰݸݩૉ
2 9 4 3 8 7 5 1 6 2
9 4 3 8 7 5 1 6 2 9 4 3 8 7 5 1 6 2 9 4 8 3 5 7 6 1 9 2
Conquer 1. ར༻ၷݸࢦඪࢦၷݸ༗ংᏐྻ A ᢛ B 2. ൺֱࢦඪࢦతᏐ值 3. ሡֱখతᏐ值์ೖ৽తᏐྻ
Cɼฒሡ֘ࢦඪ ࢦԼҰᏐ值 4. ౸ҰࢦඪࢦᏐྻ݁ඌɼሡ㠥ҰᏐྻႫ ᰨతᏐ值์ೖᏐྻ C
Merge Two Sequence 9 8 7 6 5 4 3
2 1
Merge Two Sequence 9 8 7 6 5 4 3
2 1
Merge Two Sequence 9 8 7 6 5 4 3
2 1
Merge Two Sequence 9 8 7 6 5 4 3
2 1
Merge Two Sequence 9 8 7 6 5 4 3
2 1
Merge Two Sequence 9 8 7 6 5 4 3
2 1
Merge Two Sequence 9 8 7 6 5 4 3
2 1
Merge Two Sequence 9 8 7 6 5 4 3
2 1
Merge Two Sequence 9 8 7 6 5 4 3
2 1
Merge Two Sequence 9 8 7 6 5 4 3
2 1
1 2 3 4 5 6 7 8 9 2
3 4 8 9 1 5 6 7 2 4 9 3 8 5 7 1 6 2 9 4 8 3 5 7 6 1 9 2
Natural Merge Sort
Key Point ར༻Ꮠྻதత༗ংᏐྻยஈɼҎݮগׂ࣍Ꮠʂ
༗ংᏐྻยஈ 1 3 4 2 7 9 8 0 5
1 3 4 2 7 9 8 0 5
How to Divide 1 3 4 2 7 9 8
0 5 A B
How to Divide 1 3 4 2 7 9 8
0 5 A B 1
How to Divide 1 3 4 2 7 9 8
0 5 A B 1
How to Divide 1 3 4 2 7 9 8
0 5 A B 1 3
How to Divide 1 3 4 2 7 9 8
0 5 A B 1 3
How to Divide 1 3 4 2 7 9 8
0 5 A B 1 3 4
How to Divide 1 3 4 2 7 9 8
0 5 A B 1 3 4
How to Divide 1 3 4 2 7 9 8
0 5 A B 1 3 4 1 3 4
How to Divide 1 3 4 2 7 9 8
0 5 A B 1 3 4 1 3 4 2
How to Divide 1 3 4 2 7 9 8
0 5 A B 1 3 4 1 3 4 2
How to Divide 1 3 4 2 7 9 8
0 5 A B 1 3 4 1 3 4 2 7
How to Divide 1 3 4 2 7 9 8
0 5 A B 1 3 4 1 3 4 2 7
How to Divide 1 3 4 2 7 9 8
0 5 A B 1 3 4 1 3 4 2 7 9
How to Divide 1 3 4 2 7 9 8
0 5 A B 1 3 4 1 3 4 2 7 9
How to Divide 1 3 4 2 7 9 8
0 5 A B 1 3 4 1 3 4 2 7 9 2 7 9
How to Divide 1 3 4 2 7 9 8
0 5 A B 1 3 4 1 3 4 2 7 9 2 7 9 8
How to Divide 1 3 4 2 7 9 8
0 5 A B 1 3 4 1 3 4 2 7 9 2 7 9 8
How to Divide 1 3 4 2 7 9 8
0 5 A B 1 3 4 1 3 4 2 7 9 2 7 9 8 8
How to Divide 1 3 4 2 7 9 8
0 5 A B 1 3 4 1 3 4 2 7 9 2 7 9 8 8 0
How to Divide 1 3 4 2 7 9 8
0 5 A B 1 3 4 1 3 4 2 7 9 2 7 9 8 8 0
How to Divide 1 3 4 2 7 9 8
0 5 A B 1 3 4 1 3 4 2 7 9 2 7 9 8 8 0 5
How to Divide 1 3 4 2 7 9 8
0 5 A B 1 3 4 1 3 4 2 7 9 2 7 9 8 8 0 5
How to Divide 1 3 4 2 7 9 8
0 5 A B 1 3 4 1 3 4 2 7 9 2 7 9 8 8 0 5 0 5
The merge operation is as same as traditional merge sort.
End