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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
33
Featured
See All Featured
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.4k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.7k
How to Talk to Developers About Accessibility
jct
2
130
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
200
How to Think Like a Performance Engineer
csswizardry
28
2.4k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
9.9k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
64
Building AI with AI
inesmontani
PRO
1
690
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.3k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
79
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.6k
Speed Design
sergeychernyshev
33
1.5k
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