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
merges sort
Search
Hiroki Kumamoto
July 21, 2015
0
81
merges sort
ミニ勉強会でmerge sortについて話したスライド
Hiroki Kumamoto
July 21, 2015
Tweet
Share
More Decks by Hiroki Kumamoto
See All by Hiroki Kumamoto
How to implement timetable view on iOS
kumabook
0
110
Promiseを実装してみよう
kumabook
0
330
bff_tips.pdf
kumabook
0
95
Tips of server-side rendering with react + redux
kumabook
0
88
プロトコルを使って複数サービスを跨いだmusic playerを実装する
kumabook
2
640
emacs helm likeな WebExtensions を作った話
kumabook
0
170
lightweight introducing with reactive cocoa
kumabook
0
62
basic_sort
kumabook
0
74
git_peco_tips
kumabook
0
32
Featured
See All Featured
A Tale of Four Properties
chriscoyier
162
24k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.3k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
0
190
The SEO identity crisis: Don't let AI make you average
varn
0
64
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
66
36k
The Power of CSS Pseudo Elements
geoffreycrofte
80
6.1k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
170
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
0
1.9k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
82
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
55
4 Signs Your Business is Dying
shpigford
187
22k
Scaling GitHub
holman
464
140k
Transcript
Merge Sort Hiroki Kumamoto
Merge sort • ྻΛ̎ͭʹ͚Δ • ͦΕͧΕΛιʔτʢ࠶ؼతʣ • ̎ͭΛϚʔδ͢Δ • ιʔτࡁΈͷ̎ͭͷྻΛϚʔδͯ͠ιʔτ
ࡁΈͷͷΛ࡞Δͷ؆୯ʂ
Merge sort • NݸͷཁૉΛ࣋ͭྻΛιʔτ͢Δͱ͖ͷ • ൺֱͷճ C (N) • C(N)
<= C([N/2]) + C([N/2]) + N for N > 1 • C(1) = 0 • -> N log N • ྻͷΞΫηε • A(N) <= A([N/2]) + A([N/2]) + 6N for N > 1 • A(1) = 0 • -> 6 N log N • memory༻ྔ: N
Merge sort • Improvements • ༨ͳྻΛΘͣʹin-place Ϛʔδ • ࠷ॳinsertion sort
Λ͏ (7 ݸ·Ͱ) • ͢ͰʹιʔτࡁΈͳΒ్தͰεΩοϓ
• Visualize Demo • http://kumabook.github.io/playground/ index.html#merge-sort