Upgrade to Pro — share decks privately, control downloads, hide ads and more …

merges sort

Hiroki Kumamoto
July 21, 2015
75

merges sort

ミニ勉強会でmerge sortについて話したスライド

Hiroki Kumamoto

July 21, 2015
Tweet

Transcript

  1. 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