Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
merges sort
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Hiroki Kumamoto
July 21, 2015
93
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
140
Promiseを実装してみよう
kumabook
0
370
bff_tips.pdf
kumabook
0
110
Tips of server-side rendering with react + redux
kumabook
0
110
プロトコルを使って複数サービスを跨いだmusic playerを実装する
kumabook
2
700
emacs helm likeな WebExtensions を作った話
kumabook
0
180
lightweight introducing with reactive cocoa
kumabook
0
77
basic_sort
kumabook
0
87
git_peco_tips
kumabook
0
46
Featured
See All Featured
The SEO identity crisis: Don't let AI make you average
varn
0
560
Ethics towards AI in product and experience design
skipperchong
2
380
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
510
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
670
The #1 spot is gone: here's how to win anyway
tamaranovitovic
4
1.2k
[SF Ruby Conf 2025] Rails X
palkan
3
1.4k
Agile that works and the tools we love
rasmusluckow
331
22k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
720
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.2k
Six Lessons from altMBA
skipperchong
29
4.5k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.9k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
300
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