---
id: "imported/ps/algorithm/sort/merge"
title: "Merge Sort"
description: "Merge Sort 관련 기록."
kind: "record"
published: "2023-08-08T00:00:00.000Z"
tags: []
url: "https://www.readiz.com/notes/algorithm/sort/merge/"
markdownUrl: "https://www.readiz.com/notes/algorithm/sort/merge/index.md"
---

# Merge Sort

## Merge Sort

```cpp
T tmp[MAX_SIZE]; // 실제 data size 만큼의 tmp 배열이 추가로 필요함
void mergeSort(int s, int e) {
    if (s >= e) return;

}
```

## Time Complexity

- Average: $O(N\log N)$
- Worst: $O(N\log N)$
