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
340
bff_tips.pdf
kumabook
0
97
Tips of server-side rendering with react + redux
kumabook
0
91
プロトコルを使って複数サービスを跨いだmusic playerを実装する
kumabook
2
650
emacs helm likeな WebExtensions を作った話
kumabook
0
170
lightweight introducing with reactive cocoa
kumabook
0
64
basic_sort
kumabook
0
74
git_peco_tips
kumabook
0
34
Featured
See All Featured
The Art of Programming - Codeland 2020
erikaheidi
57
14k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
140
Un-Boring Meetings
codingconduct
0
220
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
80
Building Flexible Design Systems
yeseniaperezcruz
330
40k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.8k
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.9k
Documentation Writing (for coders)
carmenintech
77
5.3k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
200
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
130
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