Nothing Special   »   [go: up one dir, main page]

0% found this document useful (0 votes)
74 views1 page

What Is A Merge Sort

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 1

What is a merge sort? Sorting algorithms improve Time & Space! Mergesort analysis: Memory Q.

How much memory does mergesort require? A. Too much!

Original input array = N. Auxiliary array for merging = N. Local variables: constant. Function call stack: log N [stay tuned]. Total = 2N + O(log N).
2

Q. How much memory do other sorting algorithms require?

N + O(1) for insertion sort and selection sort. In-place = N + O(log N).
Challenge for the bored. In-place merge. [Kronrud, 1969]

You might also like