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
89
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
merges sort
ミニ勉強会でmerge sortについて話したスライド
Hiroki Kumamoto
July 21, 2015
More Decks by Hiroki Kumamoto
See All by Hiroki Kumamoto
How to implement timetable view on iOS
kumabook
0
130
Promiseを実装してみよう
kumabook
0
360
bff_tips.pdf
kumabook
0
100
Tips of server-side rendering with react + redux
kumabook
0
100
プロトコルを使って複数サービスを跨いだmusic playerを実装する
kumabook
2
680
emacs helm likeな WebExtensions を作った話
kumabook
0
180
lightweight introducing with reactive cocoa
kumabook
0
71
basic_sort
kumabook
0
79
git_peco_tips
kumabook
0
39
Featured
See All Featured
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
550
Ethics towards AI in product and experience design
skipperchong
2
330
Six Lessons from altMBA
skipperchong
29
4.3k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
810
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.6k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
350
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
420
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
210
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
240
Site-Speed That Sticks
csswizardry
13
1.3k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
250
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
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