---
title: "Merge Sort — AP Comp Sci A Definition & Exam Guide"
description: "Merge sort is the recursive divide-and-conquer sorting algorithm on the AP CSA exam. Learn its O(n log n) runtime and how it differs from selection and insertion sort."
canonical: "https://fiveable.me/ap-comp-sci-a/key-terms/merge-sort"
type: "key-term"
subject: "AP Computer Science A"
---

# Merge Sort — AP Comp Sci A Definition & Exam Guide

## Definition

Merge Sort is an efficient, comparison-based sorting algorithm that divides an unsorted list into smaller sublists, sorts those sublists recursively, and then merges them back together to obtain a sorted list.

## Related Study Guides

- [4.15 Sorting](/ap-comp-sci-a/unit-4/sorting/study-guide/P5PACxSTKavEy6V3x3Nt)
- [4.17 Recursive Searching and Sorting](/ap-comp-sci-a/unit-4/recursive-searching-and-sorting/study-guide/tP6n1uldmjMrgteAVspr)

## Review

### Related Terms

- Quick Sort: A divide-and-conquer sorting algorithm that selects a pivot element and partitions the array around it. It recursively sorts subarrays before and after the pivot.
- Heap Sort: A comparison-based sorting algorithm that uses binary heaps to build a partially ordered tree structure which is then used for sorting.
- Radix Sort: A non-comparative integer sorting algorithm that distributes data elements into buckets based on digits or significant places.
