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
Hiroki Kumamoto
July 21, 2015
95
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
380
bff_tips.pdf
kumabook
0
110
Tips of server-side rendering with react + redux
kumabook
0
110
プロトコルを使って複数サービスを跨いだmusic playerを実装する
kumabook
2
720
emacs helm likeな WebExtensions を作った話
kumabook
0
180
lightweight introducing with reactive cocoa
kumabook
0
80
basic_sort
kumabook
0
89
git_peco_tips
kumabook
0
47
Featured
See All Featured
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.9k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
1
240
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2.2k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
430
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
800
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
550
Deep Space Network (abreviated)
tonyrice
0
410
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
50
10k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
620
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
630
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
370
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